2024-11-10 20:28:17 +00:00
|
|
|
#ifndef CX_THREAD_H
|
|
|
|
#define CX_THREAD_H
|
|
|
|
|
|
|
|
typedef struct _cx_thrd {
|
|
|
|
pthread_t thread;
|
|
|
|
void *ctx; // Arbitrary thread context
|
|
|
|
} CX_Thread;
|
|
|
|
|
|
|
|
typedef struct _cx_thrgr {
|
|
|
|
CX_Thread *group_manager;
|
|
|
|
CX_Thread **workers;
|
|
|
|
size_t worker_count;
|
|
|
|
size_t worker_size;
|
|
|
|
} CX_ThreadGroup;
|
|
|
|
|
|
|
|
CX_ThreadGroup *cx_threadGroup_new(void *(*)(void *), void *);
|
2024-11-11 16:42:57 +00:00
|
|
|
void cx_threadGroup_free(CX_ThreadGroup *);
|
2024-11-10 20:28:17 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|