|
Crinit -- Configurable Rootfs Init
|
Header defining a generic worker thread pool. Used by the notification/service interface to handle socket communication. More...
#include <limits.h>#include <pthread.h>

Go to the source code of this file.
Data Structures | |
| struct | crinitThreadPool_t |
Macros | |
| #define | CRINIT_THREADPOOL_DEFAULT_INITIAL_SIZE 8 |
| #define | CRINIT_THREADPOOL_THREAD_STACK_SIZE (PTHREAD_STACK_MIN + 112 * 1024) |
Typedefs | |
| typedef struct crinitThreadPool_t | crinitThreadPool_t |
Functions | |
| int | crinitThreadPoolInit (crinitThreadPool_t *ctx, size_t initialSize, void *(*threadFunc)(void *), const void *thrArgs, size_t thrArgsSize) |
| int | crinitThreadPoolThreadBusyCallback (crinitThreadPool_t *ctx) |
| int | crinitThreadPoolThreadAvailCallback (crinitThreadPool_t *ctx) |
Header defining a generic worker thread pool. Used by the notification/service interface to handle socket communication.
| #define CRINIT_THREADPOOL_DEFAULT_INITIAL_SIZE 8 |
Default initial size (in number of threads) of the thread pool
| #define CRINIT_THREADPOOL_THREAD_STACK_SIZE (PTHREAD_STACK_MIN + 112 * 1024) |
Stack size of the threads within the thread pool.
| typedef struct crinitThreadPool_t crinitThreadPool_t |
Structure holding a worker thread pool.
| int crinitThreadPoolInit | ( | crinitThreadPool_t * | ctx, |
| size_t | initialSize, | ||
| void *(*)(void *) | threadFunc, | ||
| const void * | thrArgs, | ||
| size_t | thrArgsSize | ||
| ) |
Initialize an crinitThreadPool_t.
| ctx | The crinitThreadPool_t to initialize. |
| initialSize | Initial size (in number of threads) of the pool. |
| threadFunc | Worker thread function to use. |
| thrArgs | Arguments to the worker thread function. Will be copied and saved in case more threads need to be started by dryPoolWatchdog. |
| thrArgsSize | Size (Bytes) of arguments to the worker thread function. |
| int crinitThreadPoolThreadAvailCallback | ( | crinitThreadPool_t * | ctx | ) |
Callback to be used by the worker thread function signalling it is idle/available.
| ctx | The crinitThreadPool_t context. |
| int crinitThreadPoolThreadBusyCallback | ( | crinitThreadPool_t * | ctx | ) |
Callback to be used by the worker thread function signalling it is busy/unavailable.
| ctx | The crinitThreadPool_t context. |