20 #ifndef _ASTERISK_THREADPOOL_H
21 #define _ASTERISK_THREADPOOL_H
71 #define AST_THREADPOOL_OPTIONS_VERSION 1
190 attribute_warn_unused_result;
int auto_increment
Number of threads to increment pool by.
char name[0]
Friendly name of the taskprocessor. Subsystem is appended after the name's NULL terminator.
void(* state_changed)(struct ast_threadpool *pool, struct ast_threadpool_listener *listener, int active_threads, int idle_threads)
Indicates that the state of threads in the pool has changed.
int idle_timeout
Time limit in seconds for idle threads.
int initial_size
Number of threads the pool will start with.
int max_size
Maximum number of threads a pool may have.
struct ast_threadpool_options options
static pj_pool_t * pool
Global memory pool for configuration and timers.
void(* shutdown)(struct ast_threadpool_listener *listener)
The threadpool is shutting down.
const struct ast_threadpool_listener_callbacks * callbacks
static int task(void *data)
Queued task for baseline test.
void(* emptied)(struct ast_threadpool *pool, struct ast_threadpool_listener *listener)
Indicates the threadpool's taskprocessor has become empty.
void(* thread_start)(void)
Function to call when a thread starts.
void(* thread_end)(void)
Function to call when a thread ends.
static struct ast_threadpool * threadpool
Thread pool for observers.
struct ast_threadpool_listener * listener
listener for a threadpool
A ast_taskprocessor structure is a singleton by name.
void(* task_pushed)(struct ast_threadpool *pool, struct ast_threadpool_listener *listener, int was_empty)
Indicates that a task was pushed to the threadpool.
An opaque threadpool structure.