summaryrefslogtreecommitdiff
path: root/src/threadpool.h
diff options
context:
space:
mode:
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
commitee3621075106ac6cff84a94432c12c89c9e45979 (patch)
treeea8441f41633753d7d26434a91783333a801f41e /src/threadpool.h
parentdb6aacd22f5c43cc6ea45e6c07bf962859ebac8d (diff)
Yeah this shit brokey
Diffstat (limited to 'src/threadpool.h')
-rw-r--r--src/threadpool.h24
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
11task * task_init(task_callback cb, void *arg); 11task * task_init(task_callback cb, void *arg);
12void task_free(task *ts); 12void task_free(task *ts);
13int task_fire(task *ts);
13 14
14cqueue * cqueue_init(int mtx_type); 15cqueue * cqueue_init(int mtx_type);
15void cqueue_free(cqueue *cq);
16int cqueue_append(cqueue * const cq, task *tsk);
17int cqueue_prepend(cqueue * const cq, task *tsk);
18int cqueue_insert(cqueue * const cq, task *tsk, int index);
19int cqueue_size(cqueue const * const cq);
20int cqueue_isempty(cqueue const * const cq);
21int cqueue_trypop(cqueue * const cq, task **ret);
22int cqueue_waitpop(cqueue * const cq, task **ret);
23int cqueue_cancel(cqueue * const cq);
24
25threadpool * threadpool_init(int threads);
26void threadpool_free(threadpool *tp);
27int threadpool_addtask(threadpool * const tp, task * const task);
28int threadpool_join(const threadpool * const tp);
29 16
30typedef struct mtxp mtxpair; 17void cqueue_cancel(cqueue *cq);
31mtxpair * mtxpair_init(void * const data, int type); 18void cqueue_free(cqueue *cq);
32void mtxpair_free(mtxpair *mp); 19int cqueue_addtask(cqueue * const cq, task * const tsk);
33int mtxpair_setdata(mtxpair * const mp, void * const data); 20task * cqueue_waitpop(cqueue * const cq);
34int 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