|
Asterisk - The Open Source Telephony Project GIT-master-4f2b068
|
#include "asterisk.h"#include "asterisk/_private.h"#include "asterisk/taskpool.h"#include "asterisk/taskprocessor.h"#include "asterisk/astobj2.h"#include "asterisk/serializer_shutdown_group.h"#include "asterisk/utils.h"#include "asterisk/time.h"#include "asterisk/sched.h"
Go to the source code of this file.
Data Structures | |
| struct | ast_taskpool |
| An opaque taskpool structure. More... | |
| struct | serializer |
| struct | taskpool_sync_task |
| struct | taskpool_taskprocessor |
| A taskpool taskprocessor. More... | |
| struct | taskpool_taskprocessors |
| A container of taskprocessors. More... | |
Macros | |
| #define | ast_taskpool_push_internal(pool, task, data) __ast_taskpool_push(pool, task, data, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
| #define | TASKPOOL_GROW_THRESHOLD (AST_TASKPROCESSOR_HIGH_WATER_LEVEL * 5) / 10 |
| The threshold for a taskprocessor at which we consider the pool needing to grow (50% of high water threshold) | |
| #define | TASKPOOL_QUEUE_SIZE_ADD(tps, size) (size += ast_taskprocessor_size(tps->taskprocessor)) |
| #define | TASKPROCESSOR_IS_IDLE(tps, timeout) (ast_tvdiff_ms(ast_tvnow(), tps->last_pushed) > (timeout)) |
Typedefs | |
| typedef void(* | taskpool_selector) (struct ast_taskpool *pool, struct taskpool_taskprocessors *taskprocessors, struct taskpool_taskprocessor **taskprocessor, unsigned int *growth_threshold_reached) |
Enumerations | |
| enum | serializer_suspension { SERIALIZER_UNSUSPENDED = 0 , SERIALIZER_SUSPENDING , SERIALIZER_SUSPENDED } |
Functions | |
| int | __ast_taskpool_push (struct ast_taskpool *pool, int(*task)(void *data), void *data, const char *file, int line, const char *function) |
| Push a task to the taskpool. | |
| int | __ast_taskpool_push_wait (struct ast_taskpool *pool, int(*task)(void *data), void *data, const char *file, int line, const char *function) |
| Push a task to the taskpool, and wait for completion. | |
| int | __ast_taskpool_serializer_push_wait (struct ast_taskprocessor *serializer, int(*task)(void *data), void *data, const char *file, int line, const char *function) |
| 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. | |
| static struct ast_taskpool * | ast_taskpool_get_current (void) |
| int | ast_taskpool_init (void) |
| int | ast_taskpool_push (struct ast_taskpool *pool, int(*task)(void *data), void *data) |
| int | ast_taskpool_push_wait (struct ast_taskpool *pool, int(*task)(void *data), void *data) |
| long | ast_taskpool_queue_size (struct ast_taskpool *pool) |
| Get the current number of queued tasks in the taskpool. | |
| struct ast_taskprocessor * | ast_taskpool_serializer (const char *name, struct ast_taskpool *pool) |
| Serialized execution of tasks within a ast_taskpool. | |
| 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_serializer_push_wait (struct ast_taskprocessor *serializer, int(*task)(void *data), void *data) |
| int | ast_taskpool_serializer_suspend (struct ast_taskprocessor *serializer) |
| Suspend a serializer, causing tasks to be queued until unsuspended. | |
| int | ast_taskpool_serializer_unsuspend (struct ast_taskprocessor *serializer) |
| Unsuspend a serializer, causing tasks to be executed. | |
| void | ast_taskpool_shutdown (struct ast_taskpool *pool) |
| Shut down a taskpool and remove the underlying taskprocessors. | |
| size_t | ast_taskpool_taskprocessors_count (struct ast_taskpool *pool) |
| Get the current number of taskprocessors in the taskpool. | |
| AST_THREADSTORAGE_RAW (current_taskpool_pool) | |
| Thread storage for the current taskpool. | |
| AST_THREADSTORAGE_RAW (current_taskpool_serializer) | |
| static int | execute_tasks (void *data) |
| static struct serializer * | serializer_create (struct ast_taskpool *pool, struct ast_serializer_shutdown_group *shutdown_group) |
| static void | serializer_dtor (void *obj) |
| static void | serializer_shutdown (struct ast_taskprocessor_listener *listener) |
| static int | serializer_start (struct ast_taskprocessor_listener *listener) |
| static void | serializer_task_pushed (struct ast_taskprocessor_listener *listener, int was_empty) |
| static void | taskpool_dynamic_pool_grow (struct ast_taskpool *pool, struct taskpool_taskprocessor **taskprocessor) |
| static int | taskpool_dynamic_pool_shrink (const void *data) |
| static void | taskpool_least_full_selector (struct ast_taskpool *pool, struct taskpool_taskprocessors *taskprocessors, struct taskpool_taskprocessor **taskprocessor, unsigned int *growth_threshold_reached) |
| Least full taskprocessor selector. | |
| static void | taskpool_sequential_selector (struct ast_taskpool *pool, struct taskpool_taskprocessors *taskprocessors, struct taskpool_taskprocessor **taskprocessor, unsigned int *growth_threshold_reached) |
| static int | taskpool_serializer_empty_task (void *data) |
| static int | taskpool_serializer_suspend_task (void *data) |
| static void | taskpool_shutdown (void) |
| static int | taskpool_sync_task (void *data) |
| static void | taskpool_sync_task_cleanup (struct taskpool_sync_task *sync_task) |
| static int | taskpool_sync_task_init (struct taskpool_sync_task *sync_task, int(*task)(void *), void *data) |
| static struct taskpool_taskprocessor * | taskpool_taskprocessor_alloc (struct ast_taskpool *pool, char type) |
| static void | taskpool_taskprocessor_dtor (void *obj) |
| static int | taskpool_taskprocessor_start (void *data) |
| static int | taskpool_taskprocessor_stop (void *data) |
| static void | taskpool_taskprocessors_cleanup (struct taskpool_taskprocessors *taskprocessors) |
| static int | taskpool_taskprocessors_init (struct taskpool_taskprocessors *taskprocessors, unsigned int size) |
Variables | |
| static struct ast_sched_context * | sched |
| Scheduler used for dynamic pool shrinking. | |
| static struct ast_taskprocessor_listener_callbacks | serializer_tps_listener_callbacks |
| #define ast_taskpool_push_internal | ( | pool, | |
| task, | |||
| data | |||
| ) | __ast_taskpool_push(pool, task, data, __FILE__, __LINE__, __PRETTY_FUNCTION__) |
Definition at line 523 of file taskpool.c.
| #define TASKPOOL_GROW_THRESHOLD (AST_TASKPROCESSOR_HIGH_WATER_LEVEL * 5) / 10 |
The threshold for a taskprocessor at which we consider the pool needing to grow (50% of high water threshold)
Definition at line 80 of file taskpool.c.
| #define TASKPOOL_QUEUE_SIZE_ADD | ( | tps, | |
| size | |||
| ) | (size += ast_taskprocessor_size(tps->taskprocessor)) |
Definition at line 462 of file taskpool.c.
| #define TASKPROCESSOR_IS_IDLE | ( | tps, | |
| timeout | |||
| ) | (ast_tvdiff_ms(ast_tvnow(), tps->last_pushed) > (timeout)) |
Definition at line 221 of file taskpool.c.
| typedef void(* taskpool_selector) (struct ast_taskpool *pool, struct taskpool_taskprocessors *taskprocessors, struct taskpool_taskprocessor **taskprocessor, unsigned int *growth_threshold_reached) |
Definition at line 51 of file taskpool.c.
| Enumerator | |
|---|---|
| SERIALIZER_UNSUSPENDED | |
| SERIALIZER_SUSPENDING | |
| SERIALIZER_SUSPENDED | |
Definition at line 696 of file taskpool.c.
| int __ast_taskpool_push | ( | struct ast_taskpool * | pool, |
| int(*)(void *data) | task, | ||
| void * | data, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | function | ||
| ) |
Push a task to the taskpool.
Tasks pushed into the taskpool will be automatically taken by one of the taskprocessors within
| pool | The taskpool to add the task to |
| task | The task to add |
| data | The parameter for the task |
| 0 | success |
| -1 | failure |
Definition at line 527 of file taskpool.c.
References __ast_taskprocessor_push(), ao2_bump, ao2_cleanup, ao2_lock, ao2_unlock, ast_tvnow(), ast_taskpool_options::auto_increment, ast_taskpool::dynamic_taskprocessors, NULL, ast_taskpool::options, RAII_VAR, ast_taskpool::selector, ast_taskpool::shutting_down, ast_taskpool::static_taskprocessors, task(), taskpool_dynamic_pool_grow(), and taskpool_taskprocessor::taskprocessor.
Referenced by __ast_sip_push_task(), __ast_taskpool_push_wait(), and ast_taskpool_push().
| int __ast_taskpool_push_wait | ( | struct ast_taskpool * | pool, |
| int(*)(void *data) | task, | ||
| void * | data, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | function | ||
| ) |
Push a task to the taskpool, and wait for completion.
Tasks pushed into the taskpool will be automatically taken by one of the taskprocessors within
| pool | The taskpool to add the task to |
| task | The task to add |
| data | The parameter for the task |
| 0 | success |
| -1 | failure |
Definition at line 635 of file taskpool.c.
References __ast_taskpool_push(), ast_cond_wait, ast_mutex_lock, ast_mutex_unlock, ast_taskpool_get_current(), taskpool_sync_task::complete, taskpool_sync_task::cond, taskpool_sync_task::fail, taskpool_sync_task::lock, task(), taskpool_sync_task_cleanup(), and taskpool_sync_task_init().
Referenced by __ast_sip_push_task_wait(), __ast_sip_push_task_wait_serializer(), and ast_taskpool_push_wait().
| int __ast_taskpool_serializer_push_wait | ( | struct ast_taskprocessor * | serializer, |
| int(*)(void *data) | task, | ||
| void * | data, | ||
| const char * | file, | ||
| int | line, | ||
| const char * | function | ||
| ) |
Push a task to a serializer, and wait for completion.
| serializer | The serializer to add the task to |
| task | The task to add |
| data | The parameter for the task |
| 0 | success |
| -1 | failure |
Definition at line 882 of file taskpool.c.
References __ast_taskprocessor_push(), ao2_lock, ao2_object_get_lockaddr(), ao2_unlock, ast_cond_wait, ast_mutex_lock, ast_mutex_unlock, ast_taskpool_get_current(), ast_taskpool_serializer_get_current(), ast_taskprocessor_execute(), ast_taskprocessor_listener_get_user_data(), ast_taskprocessor_push, ast_taskprocessor_size(), ast_threadstorage_set_ptr(), taskpool_sync_task::complete, taskpool_sync_task::cond, serializer::cond, taskpool_sync_task::fail, listener(), taskpool_sync_task::lock, NULL, SERIALIZER_SUSPENDED, serializer::suspended, task(), taskpool_serializer_empty_task(), taskpool_sync_task_cleanup(), and taskpool_sync_task_init().
Referenced by __ast_sip_push_task_wait(), __ast_sip_push_task_wait_serializer(), and ast_taskpool_serializer_push_wait().
| struct ast_taskpool * ast_taskpool_create | ( | const char * | name, |
| const struct ast_taskpool_options * | options | ||
| ) |
Create a new taskpool.
This function creates a taskpool. Tasks may be pushed onto this task pool and will be automatically acted upon by taskprocessors within the pool.
Only a single taskpool with a given name may exist. This function will fail if a taskpool with the given name already exists.
| name | The unique name for the taskpool |
| options | The behavioral options for this taskpool |
| NULL | Failed to create the taskpool |
| non-NULL | The newly-created taskpool |
Definition at line 324 of file taskpool.c.
References ao2_alloc, ao2_bump, ao2_ref, ast_log, ast_sched_add(), AST_TASKPOOL_OPTIONS_VERSION, AST_TASKPOOL_SELECTOR_DEFAULT, AST_TASKPOOL_SELECTOR_LEAST_FULL, AST_TASKPOOL_SELECTOR_SEQUENTIAL, ast_taskpool_shutdown(), AST_VECTOR_APPEND, ast_taskpool::dynamic_taskprocessors, ast_taskpool_options::growth_threshold, ast_taskpool_options::initial_size, LOG_WARNING, ast_taskpool_options::max_size, ast_taskpool_options::minimum_size, ast_taskpool::name, name, NULL, ast_taskpool::options, options, ast_taskpool::selector, ast_taskpool::shrink_sched_id, ast_taskpool::static_taskprocessors, taskpool_dynamic_pool_shrink(), TASKPOOL_GROW_THRESHOLD, taskpool_least_full_selector(), taskpool_sequential_selector(), taskpool_taskprocessor_alloc(), taskpool_taskprocessors_init(), taskpool_taskprocessor::taskprocessor, and taskpool_taskprocessors::taskprocessors.
Referenced by ast_sorcery_init(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), handle_cli_taskpool_push_efficiency(), handle_cli_taskpool_push_serializer_efficiency(), load_module(), and stasis_init().
|
static |
Definition at line 92 of file taskpool.c.
References ast_threadstorage_get_ptr().
Referenced by __ast_taskpool_push_wait(), __ast_taskpool_serializer_push_wait(), ast_taskpool_serializer_suspend(), ast_taskpool_serializer_unsuspend(), execute_tasks(), and taskpool_taskprocessor_stop().
| int ast_taskpool_init | ( | void | ) |
Provided by taskpool.c
Definition at line 1093 of file taskpool.c.
References ast_register_cleanup(), ast_sched_context_create(), ast_sched_start_thread(), and taskpool_shutdown().
Referenced by asterisk_daemon().
| int ast_taskpool_push | ( | struct ast_taskpool * | pool, |
| int(*)(void *data) | task, | ||
| void * | data | ||
| ) |
Definition at line 572 of file taskpool.c.
References __ast_taskpool_push(), NULL, and task().
| int ast_taskpool_push_wait | ( | struct ast_taskpool * | pool, |
| int(*)(void *data) | task, | ||
| void * | data | ||
| ) |
Definition at line 670 of file taskpool.c.
References __ast_taskpool_push_wait(), NULL, and task().
| long ast_taskpool_queue_size | ( | struct ast_taskpool * | pool | ) |
Get the current number of queued tasks in the taskpool.
| pool | The taskpool to query |
| The | number of queued tasks in the taskpool |
Definition at line 464 of file taskpool.c.
References ao2_lock, ao2_unlock, AST_VECTOR_CALLBACK_VOID, ast_taskpool::dynamic_taskprocessors, ast_taskpool::static_taskprocessors, TASKPOOL_QUEUE_SIZE_ADD, and taskpool_taskprocessors::taskprocessors.
Referenced by ast_sip_taskpool_queue_size().
| struct ast_taskprocessor * ast_taskpool_serializer | ( | const char * | name, |
| struct ast_taskpool * | pool | ||
| ) |
Serialized execution of tasks within a ast_taskpool.
A ast_taskprocessor with the same contract as a default taskprocessor (tasks execute serially) except instead of executing out of a dedicated thread, execution occurs in a taskprocessor from a ast_taskpool.
While it guarantees that each task will complete before executing the next, there is no guarantee as to which thread from the pool individual tasks will execute. This normally only matters if your code relies on thread specific information, such as thread locals.
Use ast_taskprocessor_unreference() to dispose of the returned ast_taskprocessor.
Only a single taskprocessor with a given name may exist. This function will fail if a taskprocessor with the given name already exists.
| name | Name of the serializer. (must be unique) |
| pool | ast_taskpool for execution. |
| NULL | on error. |
Definition at line 860 of file taskpool.c.
References ast_taskpool_serializer_group(), name, and NULL.
Referenced by AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), handle_cli_taskpool_push_serializer_efficiency(), internal_stasis_subscribe(), and sorcery_object_type_alloc().
| struct ast_taskprocessor * ast_taskpool_serializer_get_current | ( | void | ) |
Get the taskpool serializer currently associated with this thread.
| serializer | on success. |
| NULL | on error or no serializer associated with the thread. |
Definition at line 825 of file taskpool.c.
References ast_threadstorage_get_ptr().
Referenced by __ast_taskpool_serializer_push_wait(), record_serializer(), requeue_task(), rfc3326_outgoing_request(), rfc3326_outgoing_response(), serializer_efficiency_task(), and simple_task().
| 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.
A ast_taskprocessor with the same contract as a default taskprocessor (tasks execute serially) except instead of executing out of a dedicated thread, execution occurs in a taskprocessor from a ast_taskpool.
While it guarantees that each task will complete before executing the next, there is no guarantee as to which thread from the pool individual tasks will execute. This normally only matters if your code relies on thread specific information, such as thread locals.
Use ast_taskprocessor_unreference() to dispose of the returned ast_taskprocessor.
Only a single taskprocessor with a given name may exist. This function will fail if a taskprocessor with the given name already exists.
| name | Name of the serializer. (must be unique) |
| pool | ast_taskpool for execution. |
| shutdown_group | Group shutdown controller. (NULL if no group association) |
| NULL | on error. |
Definition at line 830 of file taskpool.c.
References ao2_ref, ast_serializer_shutdown_group_inc(), ast_taskprocessor_create_with_listener(), ast_taskprocessor_listener_alloc(), listener(), name, NULL, serializer_create(), serializer_tps_listener_callbacks, and shutdown_group.
Referenced by ast_serializer_taskpool_create(), ast_sip_create_serializer_group(), and ast_taskpool_serializer().
| int ast_taskpool_serializer_push_wait | ( | struct ast_taskprocessor * | serializer, |
| int(*)(void *data) | task, | ||
| void * | data | ||
| ) |
Definition at line 877 of file taskpool.c.
References __ast_taskpool_serializer_push_wait(), NULL, and task().
| int ast_taskpool_serializer_suspend | ( | struct ast_taskprocessor * | serializer | ) |
Suspend a serializer, causing tasks to be queued until unsuspended.
| serializer | The serializer to suspend |
| 0 | success |
| -1 | failure |
Definition at line 1001 of file taskpool.c.
References ao2_lock, ao2_unlock, ast_taskpool_get_current(), ast_taskpool_serializer_push_wait, ast_taskprocessor_listener_get_user_data(), listener(), SERIALIZER_SUSPENDING, SERIALIZER_UNSUSPENDED, serializer::suspended, and taskpool_serializer_suspend_task().
Referenced by ast_sip_session_suspend(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
| int ast_taskpool_serializer_unsuspend | ( | struct ast_taskprocessor * | serializer | ) |
Unsuspend a serializer, causing tasks to be executed.
| serializer | The serializer to unsuspend |
| 0 | success |
| -1 | failure |
Definition at line 1050 of file taskpool.c.
References ao2_bump, ao2_lock, ao2_unlock, ast_cond_broadcast, ast_taskpool_get_current(), ast_taskpool_push, ast_taskprocessor_listener_get_user_data(), ast_taskprocessor_unreference(), serializer::cond, execute_tasks(), listener(), serializer::pool, SERIALIZER_SUSPENDED, SERIALIZER_UNSUSPENDED, and serializer::suspended.
Referenced by ast_sip_session_unsuspend(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), and AST_TEST_DEFINE().
| void ast_taskpool_shutdown | ( | struct ast_taskpool * | pool | ) |
Shut down a taskpool and remove the underlying taskprocessors.
| pool | The pool to shut down |
Definition at line 675 of file taskpool.c.
References ao2_lock, ao2_ref, ao2_unlock, AST_SCHED_DEL_UNREF, ast_taskpool::dynamic_taskprocessors, ast_taskpool::shrink_sched_id, ast_taskpool::shutting_down, ast_taskpool::static_taskprocessors, and taskpool_taskprocessors_cleanup().
Referenced by ast_taskpool_create(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), AST_TEST_DEFINE(), handle_cli_taskpool_push_efficiency(), handle_cli_taskpool_push_serializer_efficiency(), load_module(), sorcery_cleanup(), stasis_cleanup(), and unload_module().
| size_t ast_taskpool_taskprocessors_count | ( | struct ast_taskpool * | pool | ) |
Get the current number of taskprocessors in the taskpool.
| pool | The taskpool to query |
| The | number of taskprocessors in the taskpool |
Definition at line 451 of file taskpool.c.
References ao2_lock, ao2_unlock, AST_VECTOR_SIZE, ast_taskpool::dynamic_taskprocessors, ast_taskpool::static_taskprocessors, and taskpool_taskprocessors::taskprocessors.
Referenced by AST_TEST_DEFINE(), and AST_TEST_DEFINE().
| AST_THREADSTORAGE_RAW | ( | current_taskpool_pool | ) |
Thread storage for the current taskpool.
| AST_THREADSTORAGE_RAW | ( | current_taskpool_serializer | ) |
|
static |
Definition at line 742 of file taskpool.c.
References ao2_lock, ao2_unlock, ast_taskpool_get_current(), ast_taskpool_push, ast_taskprocessor_execute(), ast_taskprocessor_listener_get_user_data(), ast_taskprocessor_size(), ast_taskprocessor_unreference(), ast_threadstorage_set_ptr(), execute_tasks(), listener(), NULL, serializer::pool, SERIALIZER_SUSPENDED, serializer::suspended, and ast_taskprocessor_listener::tps.
Referenced by ast_taskpool_serializer_unsuspend(), execute_tasks(), and serializer_task_pushed().
|
static |
Definition at line 722 of file taskpool.c.
References ao2_alloc, ao2_bump, ast_cond_init, serializer::cond, NULL, serializer::pool, serializer_dtor(), serializer::shutdown_group, and shutdown_group.
Referenced by ast_taskpool_serializer_group().
|
static |
Definition at line 713 of file taskpool.c.
References ao2_cleanup, ast_cond_destroy, serializer::cond, serializer::pool, and serializer::shutdown_group.
Referenced by serializer_create().
|
static |
Definition at line 809 of file taskpool.c.
References ao2_cleanup, ast_serializer_shutdown_group_dec(), ast_taskprocessor_listener_get_user_data(), listener(), and serializer::shutdown_group.
|
static |
Definition at line 803 of file taskpool.c.
|
static |
Definition at line 791 of file taskpool.c.
References ast_taskpool_push, ast_taskprocessor_listener_get_tps(), ast_taskprocessor_listener_get_user_data(), ast_taskprocessor_unreference(), execute_tasks(), listener(), and serializer::pool.
|
static |
Definition at line 479 of file taskpool.c.
References ao2_ref, AST_VECTOR_APPEND, AST_VECTOR_SIZE, ast_taskpool_options::auto_increment, ast_taskpool::dynamic_taskprocessors, ast_taskpool_options::max_size, ast_taskpool::options, ast_taskpool::static_taskprocessors, taskpool_taskprocessor_alloc(), taskpool_taskprocessor::taskprocessor, taskpool_taskprocessors::taskprocessor_num, and taskpool_taskprocessors::taskprocessors.
Referenced by __ast_taskpool_push().
|
static |
Definition at line 226 of file taskpool.c.
References ao2_cleanup, ao2_lock, ao2_ref, ao2_unlock, AST_VECTOR_REMOVE_ALL_CMP_UNORDERED, AST_VECTOR_SIZE, ast_taskpool::dynamic_taskprocessors, ast_taskpool_options::idle_timeout, ast_taskpool::options, ast_taskpool::shutting_down, TASKPROCESSOR_IS_IDLE, taskpool_taskprocessors::taskprocessor_num, and taskpool_taskprocessors::taskprocessors.
Referenced by ast_taskpool_create().
|
static |
Least full taskprocessor selector.
\interal
Definition at line 287 of file taskpool.c.
References ast_taskprocessor_size(), AST_VECTOR_GET, AST_VECTOR_SIZE, ast_taskpool_options::growth_threshold, NULL, ast_taskpool::options, taskpool_taskprocessor::taskprocessor, and taskpool_taskprocessors::taskprocessors.
Referenced by ast_taskpool_create().
|
static |
Definition at line 262 of file taskpool.c.
References ast_taskprocessor_size(), AST_VECTOR_GET, AST_VECTOR_SIZE, ast_taskpool_options::growth_threshold, ast_taskpool::options, taskpool_taskprocessors::taskprocessor_num, and taskpool_taskprocessors::taskprocessors.
Referenced by ast_taskpool_create().
|
static |
Definition at line 868 of file taskpool.c.
Referenced by __ast_taskpool_serializer_push_wait(), and taskpool_serializer_suspend_task().
|
static |
Definition at line 978 of file taskpool.c.
References ast_taskprocessor_listener_get_user_data(), ast_taskprocessor_push, listener(), NULL, SERIALIZER_SUSPENDED, serializer::suspended, and taskpool_serializer_empty_task().
Referenced by ast_taskpool_serializer_suspend().
|
static |
Definition at line 1085 of file taskpool.c.
References ast_sched_context_destroy(), and NULL.
Referenced by ast_taskpool_init().
|
static |
Definition at line 615 of file taskpool.c.
References ast_cond_signal, ast_mutex_lock, ast_mutex_unlock, taskpool_sync_task::complete, taskpool_sync_task::cond, taskpool_sync_task::fail, taskpool_sync_task::lock, taskpool_sync_task::task, and taskpool_sync_task::task_data.
|
static |
Definition at line 606 of file taskpool.c.
References ast_cond_destroy, ast_mutex_destroy, taskpool_sync_task::cond, and taskpool_sync_task::lock.
Referenced by __ast_taskpool_push_wait(), and __ast_taskpool_serializer_push_wait().
|
static |
Definition at line 592 of file taskpool.c.
References ast_cond_init, ast_mutex_init, taskpool_sync_task::complete, taskpool_sync_task::cond, taskpool_sync_task::fail, taskpool_sync_task::lock, NULL, task(), taskpool_sync_task::task, and taskpool_sync_task::task_data.
Referenced by __ast_taskpool_push_wait(), and __ast_taskpool_serializer_push_wait().
|
static |
Definition at line 152 of file taskpool.c.
References AO2_ALLOC_OPT_LOCK_NOLOCK, ao2_alloc_options, ao2_bump, ao2_ref, ast_taskprocessor_build_name(), ast_taskprocessor_get(), AST_TASKPROCESSOR_MAX_NAME, ast_taskprocessor_push, ast_taskprocessor_unreference(), ast_tvnow(), ast_taskpool::name, NULL, taskpool_taskprocessor_dtor(), taskpool_taskprocessor_start(), taskpool_taskprocessor::taskprocessor, TPS_REF_DEFAULT, and type.
Referenced by ast_taskpool_create(), and taskpool_dynamic_pool_grow().
|
static |
Definition at line 116 of file taskpool.c.
References ast_taskprocessor_push, ast_taskprocessor_unreference(), NULL, taskpool_taskprocessor_stop(), and taskpool_taskprocessor::taskprocessor.
Referenced by taskpool_taskprocessor_alloc().
|
static |
Definition at line 131 of file taskpool.c.
References ast_threadstorage_set_ptr(), ast_taskpool::options, and ast_taskpool_options::thread_start.
Referenced by taskpool_taskprocessor_alloc().
|
static |
Definition at line 101 of file taskpool.c.
References ao2_cleanup, ast_taskpool_get_current(), ast_taskpool::options, and ast_taskpool_options::thread_end.
Referenced by taskpool_taskprocessor_dtor().
|
static |
Definition at line 206 of file taskpool.c.
References ao2_cleanup, AST_VECTOR_CALLBACK_VOID, AST_VECTOR_FREE, and taskpool_taskprocessors::taskprocessors.
Referenced by ast_taskpool_shutdown().
|
static |
Definition at line 193 of file taskpool.c.
References AST_VECTOR_INIT, and taskpool_taskprocessors::taskprocessors.
Referenced by ast_taskpool_create().
|
static |
Scheduler used for dynamic pool shrinking.
Definition at line 83 of file taskpool.c.
|
static |
Definition at line 819 of file taskpool.c.
Referenced by ast_taskpool_serializer_group().