XThreadPool
typedef struct XThreadPool XThreadPool;
typedef struct XThreadPool XThreadPool;
typedef void(*XThreadTask)(void *arg);
Create a thread pool with a fixed number of worker threads.
XThreadPool * x_threadpool_create(int num_threads);
int num_threadsThread pool handle, or NULL on failure.
Destroy a thread pool and release its resources.
void x_threadpool_destroy(XThreadPool *pool);
XThreadPool *poolEnqueue a task for execution by the thread pool.
int32_t x_threadpool_enqueue(
XThreadPool *pool,
XThreadTask fn,
void *arg
);
XThreadPool *poolXThreadTask fnvoid *arg0 on success, non-zero on failure.