#include "arena.h" #include "ll.h" #include "encryption.h" #include "scanner.h" #include "shared.h" #include "threadpool.h" #include #include #include #include int testcb(void *data) { if(!data) return -1; printf("%s\n", (char*)data); return 0; } int consumer(void *cq) { if(!cq) return -1; cqueue *rcq = (cqueue*)cq; for(task *tsk = NULL;;) { tsk = cqueue_waitpop(rcq); if(!tsk) thrd_exit(-1); task_fire(tsk); } return 0; } int main() { // error(1, ENOTSUP, "No main file lol"); thrd_t thread; cqueue *cq = cqueue_init(mtx_plain); thrd_create(&thread, consumer, cq); cqueue_addtask(cq, task_init(testcb, (void*)"This is some data")); sleep(10); cqueue_free(cq); return 0; }