libresman
view src/threadpool.h @ 22:174ddb6bf92a
separated platform-specific filewatch code
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 12 Feb 2014 22:32:30 +0200 |
parents | 410c19c735b2 |
children |
line source
1 #ifndef THREAD_POOL_H_
2 #define THREAD_POOL_H_
4 struct thread_pool;
6 typedef void (*tpool_work_func)(void *data, void *cls);
8 #define TPOOL_AUTO 0
9 int tpool_init(struct thread_pool *tpool, int num_threads);
10 void tpool_destroy(struct thread_pool *tpool);
12 struct thread_pool *tpool_create(int num_threads);
13 void tpool_free(struct thread_pool *tpool);
15 void tpool_set_work_func(struct thread_pool *tpool, tpool_work_func func, void *cls);
17 int tpool_add_work(struct thread_pool *tpool, void *data);
19 #endif /* THREAD_POOL_H_ */