#include #include #ifndef __TPOOL_H #define __TPOOL_H struct tpool; typedef struct tpool tpool_t; extern tpool_t *tpool; typedef void (*thread_func_t)(void *arg); tpool_t *tpool_create(size_t num); void tpool_destroy(tpool_t *tp); bool tpool_add_work(tpool_t *tp, thread_func_t func, void *arg); void tpool_wait(tpool_t *tp); #endif