1 #ifndef ACL_PTHREAD_POOL_INCLUDE_H 2 #define ACL_PTHREAD_POOL_INCLUDE_H 4 #include "../stdlib/acl_define.h" 25 void *run_arg,
int fixed);
43 #define ACL_PTHREAD_POOL_DEF_THREADS 100 45 #define ACL_PTHREAD_POOL_DEF_IDLE 0 56 int threads_limit,
int idle_timeout);
86 int (*init_fn)(
void *),
void *init_arg);
96 void (*free_fn)(
void *),
void *free_arg);
119 void (*run_fn)(
void *),
void *run_arg);
120 #define acl_pthread_pool_add acl_pthread_pool_add_one 143 void (*run_fn)(
void *),
void *run_arg);
169 int (*poller_fn)(
void *),
void *poller_arg);
182 void (*run_fn)(
void *),
void *run_arg);
192 void (*run_fn)(
void *),
void *run_arg);
ACL_API int acl_pthread_pool_busy(acl_pthread_pool_t *thr_pool)
ACL_API void acl_pthread_pool_bat_add_end(acl_pthread_pool_t *thr_pool)
struct acl_pthread_pool_attr_t acl_pthread_pool_attr_t
ACL_API int acl_pthread_pool_idle(acl_pthread_pool_t *thr_pool)
ACL_API int acl_pthread_pool_destroy(acl_pthread_pool_t *thr_pool)
ACL_API void acl_pthread_pool_attr_set_threads_limit(acl_pthread_pool_attr_t *attr, int threads_limit)
ACL_API int acl_pthread_pool_start_poller(acl_pthread_pool_t *thr_pool)
ACL_API void acl_pthread_pool_set_schedule_wait(acl_pthread_pool_t *thr_pool, acl_int64 n)
ACL_API void acl_pthread_pool_add_one(acl_pthread_pool_t *thr_pool, void(*run_fn)(void *), void *run_arg)
ACL_API void acl_pthread_pool_set_poller(acl_pthread_pool_t *thr_pool, int(*poller_fn)(void *), void *poller_arg)
ACL_API void acl_pthread_pool_attr_set_idle_timeout(acl_pthread_pool_attr_t *attr, int idle_timeout)
ACL_API void acl_pthread_pool_bat_add_begin(acl_pthread_pool_t *thr_pool)
ACL_API void acl_pthread_pool_attr_set_stacksize(acl_pthread_pool_attr_t *attr, size_t size)
ACL_API acl_pthread_job_t * acl_pthread_pool_alloc_job(void(*run_fn)(void *), void *run_arg, int fixed)
ACL_API void acl_pthread_pool_bat_add_one(acl_pthread_pool_t *thr_pool, void(*run_fn)(void *), void *run_arg)
struct acl_pthread_job_t acl_pthread_job_t
ACL_API int acl_pthread_pool_atinit(acl_pthread_pool_t *thr_pool, int(*init_fn)(void *), void *init_arg)
ACL_API void acl_pthread_pool_set_schedule_warn(acl_pthread_pool_t *thr_pool, acl_int64 n)
ACL_API void acl_pthread_pool_set_stacksize(acl_pthread_pool_t *thr_pool, size_t size)
ACL_API int acl_pthread_pool_size(acl_pthread_pool_t *thr_pool)
struct acl_pthread_pool_t acl_pthread_pool_t
ACL_API void acl_pthread_pool_add_job(acl_pthread_pool_t *thr_pool, acl_pthread_job_t *job)
ACL_API void acl_pthread_pool_bat_add_job(acl_pthread_pool_t *thr_pool, acl_pthread_job_t *job)
ACL_API int acl_pthread_pool_dispatch(void *dispatch_arg, void(*run_fn)(void *), void *run_arg)
ACL_API int acl_pthread_pool_set_timewait(acl_pthread_pool_t *thr_pool, int timewait_sec)
ACL_API acl_pthread_pool_t * acl_thread_pool_create(int threads_limit, int idle_timeout)
ACL_API int acl_pthread_pool_stop(acl_pthread_pool_t *thr_pool)
ACL_API void acl_pthread_pool_set_qlen_warn(acl_pthread_pool_t *thr_pool, int max)
ACL_API void acl_pthread_pool_attr_init(acl_pthread_pool_attr_t *attr)
ACL_API int acl_pthread_pool_limit(acl_pthread_pool_t *thr_pool)
ACL_API int acl_pthread_pool_atfree(acl_pthread_pool_t *thr_pool, void(*free_fn)(void *), void *free_arg)
ACL_API void acl_pthread_pool_free_job(acl_pthread_job_t *job)
ACL_API int acl_pthread_pool_qlen(acl_pthread_pool_t *thr_pool)
ACL_API int acl_pthread_pool_add_dispatch(void *dispatch_arg, void(*run_fn)(void *), void *run_arg)
ACL_API acl_pthread_pool_t * acl_pthread_pool_create(const acl_pthread_pool_attr_t *attr)