52#ifndef _ASTERISK_TASKPOOL_H
53#define _ASTERISK_TASKPOOL_H
69#define AST_TASKPOOL_OPTIONS_VERSION 1
#define attribute_warn_unused_result
static struct ast_serializer_shutdown_group * shutdown_group
Shutdown group for options serializers.
void(* thread_start)(void)
Function to call when a taskprocessor starts.
int idle_timeout
Time limit in seconds for idle dynamic taskprocessors.
enum ast_taskpool_selector selector
The selector to use for choosing a taskprocessor.
int max_size
Maximum number of taskprocessors a pool may have.
void(* thread_end)(void)
Function to call when a taskprocessor ends.
int auto_increment
Number of taskprocessors to increment the pool by.
int growth_threshold
The threshold for when to grow the pool.
int minimum_size
Number of taskprocessors that will always exist.
int initial_size
Number of taskprocessors the pool will start with.
An opaque taskpool structure.
A ast_taskprocessor structure is a singleton by name.
size_t ast_taskpool_taskprocessors_count(struct ast_taskpool *pool)
Get the current number of taskprocessors in the taskpool.
struct ast_taskprocessor * ast_taskpool_serializer(const char *name, struct ast_taskpool *pool)
Serialized execution of tasks within a ast_taskpool.
void ast_taskpool_shutdown(struct ast_taskpool *pool)
Shut down a taskpool and remove the underlying taskprocessors.
struct ast_taskprocessor * ast_taskpool_serializer_get_current(void)
Get the taskpool serializer currently associated with this thread.
struct ast_taskprocessor * ast_taskpool_serializer_group(const char *name, struct ast_taskpool *pool, struct ast_serializer_shutdown_group *shutdown_group)
Serialized execution of tasks within a ast_taskpool.
int ast_taskpool_push(struct ast_taskpool *pool, int(*task)(void *data), void *data) attribute_warn_unused_result
Push a task to the taskpool.
ast_taskpool_selector
Selectors for choosing which taskprocessor in a pool to use.
@ AST_TASKPOOL_SELECTOR_SEQUENTIAL
@ AST_TASKPOOL_SELECTOR_LEAST_FULL
@ AST_TASKPOOL_SELECTOR_DEFAULT
int ast_taskpool_serializer_push_wait(struct ast_taskprocessor *serializer, int(*task)(void *data), void *data)
Push a task to a serializer, and wait for completion.
struct ast_taskpool * ast_taskpool_create(const char *name, const struct ast_taskpool_options *options)
Create a new taskpool.
long ast_taskpool_queue_size(struct ast_taskpool *pool)
Get the current number of queued tasks in the taskpool.
int ast_taskpool_push_wait(struct ast_taskpool *pool, int(*task)(void *data), void *data) attribute_warn_unused_result
Push a task to the taskpool, and wait for completion.
static int task(void *data)
Queued task for baseline test.