summaryrefslogtreecommitdiff
path: root/src/threadpool.c
diff options
context:
space:
mode:
author@syxhe <https://t.me/syxhe>2025-04-17 21:56:23 -0500
committer@syxhe <https://t.me/syxhe>2025-04-17 21:56:23 -0500
commitd47f45a5e3e40b48131409071b119b442c78bffc (patch)
tree95e95ac5cbf2be1fec5402452d586a3400d90a02 /src/threadpool.c
parent9bd10281119a28323ddd05bd13827bceb553cc56 (diff)
Create ll-internal files to maintain opaqueness of linked list while opening it up for reuse
Diffstat (limited to 'src/threadpool.c')
-rw-r--r--src/threadpool.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/threadpool.c b/src/threadpool.c
index 8f1cf0b..d058d52 100644
--- a/src/threadpool.c
+++ b/src/threadpool.c
@@ -1,6 +1,9 @@
1#include "threadpool.h" 1#include "threadpool.h"
2#include "shared.h" 2#include "shared.h"
3 3
4#include "ll-internal.h"
5#include "ll.h"
6
4#include <threads.h> 7#include <threads.h>
5#include <stdlib.h> 8#include <stdlib.h>
6#include <errno.h> 9#include <errno.h>
@@ -31,7 +34,7 @@ mtxpair * mtxpair_init(void * const data, int type) {
31 34
32 // Init the mutex 35 // Init the mutex
33 if(mtx_init(mtxp->mtx, type) == thrd_error) { 36 if(mtx_init(mtxp->mtx, type) == thrd_error) {
34 free(mtxp); free(mtxp->mtx); 37 free(mtxp->mtx); free(mtxp);
35 RETURNWERR(errno, NULL); 38 RETURNWERR(errno, NULL);
36 } 39 }
37 40
@@ -93,7 +96,7 @@ int thrd_createwmx(thrd_t * const thr, thrd_start_t func, mtxpair * const mtxd)
93// Here's a good reference of this implemented in C++ using Boost: https://gist.github.com/mikeando/482342 96// Here's a good reference of this implemented in C++ using Boost: https://gist.github.com/mikeando/482342
94 97
95typedef struct cq { 98typedef struct cq {
96 99 void*placehoilder;
97} cqueue; 100} cqueue;
98 101
99typedef struct task { 102typedef struct task {