diff options
Diffstat (limited to 'src/main.c')
| -rwxr-xr-x | src/main.c | 29 |
1 files changed, 26 insertions, 3 deletions
| @@ -5,10 +5,33 @@ | |||
| 5 | #include "shared.h" | 5 | #include "shared.h" |
| 6 | #include "threadpool.h" | 6 | #include "threadpool.h" |
| 7 | 7 | ||
| 8 | #include "errno.h" | 8 | #include <errno.h> |
| 9 | #include "error.h" | 9 | #include <error.h> |
| 10 | #include <printf.h> | ||
| 11 | #include <unistd.h> | ||
| 12 | |||
| 13 | int testcb(void *arg) { | ||
| 14 | if(!arg) | ||
| 15 | return -1; | ||
| 16 | |||
| 17 | printf("%s\n", (char*)arg); | ||
| 18 | |||
| 19 | return 0; | ||
| 20 | } | ||
| 10 | 21 | ||
| 11 | int main() { | 22 | int main() { |
| 12 | error(-1, ENOTSUP, "lol"); | 23 | // error(-1, ENOTSUP, "lol"); |
| 24 | |||
| 25 | cqueue *cq = cqueue_init(); | ||
| 26 | // if(!cq) | ||
| 27 | // abort(); | ||
| 28 | |||
| 29 | cqueue_registerthreads(cq, 10); | ||
| 30 | cqueue_addtask(cq, task_init(testcb, "this is some data")); | ||
| 31 | |||
| 32 | sleep(3); | ||
| 33 | |||
| 34 | cqueue_free(cq); | ||
| 35 | |||
| 13 | return 0; | 36 | return 0; |
| 14 | } \ No newline at end of file | 37 | } \ No newline at end of file |
