Go to the source code of this file.
Data Structures | |
struct | as_thread_pool |
Typedefs | |
typedef void(* | as_fini_fn )(void) |
typedef void(* | as_task_fn )(void *user_data) |
Functions | |
int | as_thread_pool_destroy (as_thread_pool *pool) |
int | as_thread_pool_init (as_thread_pool *pool, uint32_t thread_size) |
int | as_thread_pool_queue_task (as_thread_pool *pool, as_task_fn task_fn, void *task) |
typedef void(* as_fini_fn)(void) |
Thread finalization function callback.
Definition at line 41 of file as_thread_pool.h.
typedef void(* as_task_fn)(void *user_data) |
Task function callback.
Definition at line 35 of file as_thread_pool.h.
|
private |
Destroy thread pool.
Returns: 0 : Success -1 : Failed to lock mutex -2 : Pool has already been closed
|
private |
Initialize variable task thread pool and start thread_size threads. Multiple task types can be handled in variable task thread pools.
Returns: 0 : Success -1 : Failed to initialize mutex lock -2 : Failed to lock mutex -3 : Some threads failed to start
|
private |
Queue a variable task onto thread pool.
Returns: 0 : Success -1 : No threads are running to process task. -2 : Failed to push task onto dispatch queue