Asterisk - The Open Source Telephony Project
18.5.0
|
#include <threadpool.h>
Data Fields | |
int | auto_increment |
Number of threads to increment pool by. More... | |
int | idle_timeout |
Time limit in seconds for idle threads. More... | |
int | initial_size |
Number of threads the pool will start with. More... | |
int | max_size |
Maximum number of threads a pool may have. More... | |
void(* | thread_end )(void) |
Function to call when a thread ends. More... | |
void(* | thread_start )(void) |
Function to call when a thread starts. More... | |
int | version |
Definition at line 70 of file threadpool.h.
int auto_increment |
Number of threads to increment pool by.
If a task is added into a pool and no idle thread is available to activate, then the pool can automatically grow by the given amount.
Zero is a perfectly valid value to give here if you want to control threadpool growth yourself via your listener.
Definition at line 90 of file threadpool.h.
Referenced by queued_task_pushed(), stasis_init(), and system_apply().
int idle_timeout |
Time limit in seconds for idle threads.
A time of 0 or less will mean no timeout.
Definition at line 79 of file threadpool.h.
Referenced by AST_TEST_DEFINE(), stasis_init(), system_apply(), and worker_idle().
int initial_size |
Number of threads the pool will start with.
When the threadpool is allocated, it will immediately size itself to have this number of threads in it.
Zero is a valid value if the threadpool should start without any threads allocated.
Definition at line 100 of file threadpool.h.
Referenced by stasis_init(), and system_apply().
int max_size |
Maximum number of threads a pool may have.
When the threadpool's size increases, it can never increase beyond this number of threads.
Zero is a valid value if the threadpool does not have a maximum size.
Definition at line 110 of file threadpool.h.
Referenced by grow(), stasis_init(), and system_apply().
void(* thread_end) (void) |
Function to call when a thread ends.
This is useful if there is common cleanup to execute when a thread completes
Definition at line 124 of file threadpool.h.
Referenced by worker_start().
void(* thread_start) (void) |
Function to call when a thread starts.
This is useful if there is something common that all threads in a threadpool need to do when they start.
Definition at line 117 of file threadpool.h.
Referenced by load_module(), and worker_start().
int version |
Version of threadpool options in use
Definition at line 73 of file threadpool.h.
Referenced by ast_sorcery_init(), AST_TEST_DEFINE(), ast_threadpool_create(), ParsingContext::next(), and stasis_init().