File tree Expand file tree Collapse file tree 3 files changed +430
-0
lines changed
Expand file tree Collapse file tree 3 files changed +430
-0
lines changed Original file line number Diff line number Diff line change 1+ #ifndef QT_THREADPOOL_H
2+ #define QT_THREADPOOL_H
3+
4+ #include <stdint.h>
5+
6+ #include <qthread/common.h>
7+
8+ typedef int (* qt_threadpool_func_type )(void * );
9+
10+ typedef enum {
11+ POOL_INIT_SUCCESS ,
12+ POOL_INIT_ALREADY_INITIALIZED ,
13+ POOL_INIT_NO_THREADS_SPECIFIED ,
14+ POOL_INIT_OUT_OF_MEMORY ,
15+ // TODO: better granularity when forwarding errors from thread creation.
16+ POOL_INIT_ERROR
17+ } hw_pool_init_status ;
18+
19+ hw_pool_init_status hw_pool_init (uint32_t num_threads );
20+ void hw_pool_destroy ();
21+ void hw_pool_run_on_all (qt_threadpool_func_type func , void * arg );
22+
23+ #endif
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ set(QTHREADS_SOURCES
3535 alloc/${QTHREADS_ALLOC} .c
3636 affinity/common.c
3737 affinity/${QTHREADS_TOPOLOGY} .c
38+ threadpool.c
3839 touch.c
3940 tls.c
4041 teams.c
You can’t perform that action at this time.
0 commit comments