diff options
| author | @syxhe <https://t.me/syxhe> | 2025-04-24 23:08:28 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-04-24 23:08:28 -0500 |
| commit | ee3621075106ac6cff84a94432c12c89c9e45979 (patch) | |
| tree | ea8441f41633753d7d26434a91783333a801f41e /src/threadpool.h | |
| parent | db6aacd22f5c43cc6ea45e6c07bf962859ebac8d (diff) | |
Yeah this shit brokey
Diffstat (limited to 'src/threadpool.h')
| -rw-r--r-- | src/threadpool.h | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/src/threadpool.h b/src/threadpool.h index bc3ce06..bd1b787 100644 --- a/src/threadpool.h +++ b/src/threadpool.h | |||
| @@ -10,27 +10,13 @@ typedef struct tp threadpool; | |||
| 10 | 10 | ||
| 11 | task * task_init(task_callback cb, void *arg); | 11 | task * task_init(task_callback cb, void *arg); |
| 12 | void task_free(task *ts); | 12 | void task_free(task *ts); |
| 13 | int task_fire(task *ts); | ||
| 13 | 14 | ||
| 14 | cqueue * cqueue_init(int mtx_type); | 15 | cqueue * cqueue_init(int mtx_type); |
| 15 | void cqueue_free(cqueue *cq); | ||
| 16 | int cqueue_append(cqueue * const cq, task *tsk); | ||
| 17 | int cqueue_prepend(cqueue * const cq, task *tsk); | ||
| 18 | int cqueue_insert(cqueue * const cq, task *tsk, int index); | ||
| 19 | int cqueue_size(cqueue const * const cq); | ||
| 20 | int cqueue_isempty(cqueue const * const cq); | ||
| 21 | int cqueue_trypop(cqueue * const cq, task **ret); | ||
| 22 | int cqueue_waitpop(cqueue * const cq, task **ret); | ||
| 23 | int cqueue_cancel(cqueue * const cq); | ||
| 24 | |||
| 25 | threadpool * threadpool_init(int threads); | ||
| 26 | void threadpool_free(threadpool *tp); | ||
| 27 | int threadpool_addtask(threadpool * const tp, task * const task); | ||
| 28 | int threadpool_join(const threadpool * const tp); | ||
| 29 | 16 | ||
| 30 | typedef struct mtxp mtxpair; | 17 | void cqueue_cancel(cqueue *cq); |
| 31 | mtxpair * mtxpair_init(void * const data, int type); | 18 | void cqueue_free(cqueue *cq); |
| 32 | void mtxpair_free(mtxpair *mp); | 19 | int cqueue_addtask(cqueue * const cq, task * const tsk); |
| 33 | int mtxpair_setdata(mtxpair * const mp, void * const data); | 20 | task * cqueue_waitpop(cqueue * const cq); |
| 34 | int thrd_createwmx(thrd_t * const thr, thrd_start_t func, mtxpair * const mtxd); | ||
| 35 | 21 | ||
| 36 | #endif \ No newline at end of file | 22 | #endif \ No newline at end of file |
