82#ifndef __THREADPOOL_H__
83#define __THREADPOOL_H__
A unit of work submitted to the pool.
void(* function)(void *arg)
bool threadpool_submit(Threadpool *pool, void(*function)(void *), void *arg)
Submit a single task to the pool.
size_t threadpool_submit_batch(Threadpool *pool, void(**functions)(void *), void **args, size_t count)
Submit multiple tasks to the pool in a single call.
Threadpool * threadpool_create(size_t num_threads)
Create a new thread pool.
void threadpool_destroy(Threadpool *pool, int timeout_ms)
Drain all pending tasks, stop all workers, and free the pool.
void threadpool_wait(Threadpool *pool)
Block until all currently submitted tasks have completed.
struct Threadpool Threadpool
Opaque handle to a thread pool instance.