48 printf(
"FAIL: no pool\n");
52 printf(
"FAIL: could not add proc\n");
57 printf(
"ex_thread_pool_wait: all checks passed\n");
static NETWORK_POOL * pool
static void * slow_proc(void *p)
#define LOG_ERR
error conditions
void set_log_level(const int log_level)
Set the global log level value ( static int LOG_LEVEL ).
#define NORMAL_PROC
processing mode for added func, synced start, can be queued
THREAD_POOL * new_thread_pool(size_t nbmaxthr, size_t nb_max_waiting)
Create a new pool of nbmaxthr threads.
int add_threaded_process(THREAD_POOL *thread_pool, void *(*func_ptr)(void *param), void *param, int mode)
add a function and params to a thread pool
int wait_for_threaded_pool(THREAD_POOL *thread_pool)
Wait for the thread pool to become idle (no active threads, empty waiting list), blocking without pol...
int destroy_threaded_pool(THREAD_POOL **pool, unsigned int delay)
Stop every thread of a pool and free it.
Structure of a thread pool.
Common headers and low-level functions & define.