diff -r eebc3d32c7c1 -r f45e962edf45 src/server/util/thrpool.c --- a/src/server/util/thrpool.c Sat May 14 11:18:14 2022 +0200 +++ b/src/server/util/thrpool.c Sat May 14 12:45:59 2022 +0200 @@ -47,18 +47,21 @@ pthread_mutex_init(&pool->queue_lock, NULL); pthread_mutex_init(&pool->avlbl_lock, NULL); - pthread_cond_init(&pool->available, NULL); + pthread_cond_init(&pool->available, NULL); + return pool; +} + +int threadpool_start(threadpool_t *pool) { /* create pool threads */ - for(int i=0;imin_threads;i++) { pthread_t t; if (pthread_create(&t, NULL, threadpool_func, pool) != 0) { - perror("Error: threadpool_new: pthread_create"); - return NULL; + perror("Error: threadpool_start: pthread_create"); + return 1; } } - - return pool; + return 0; } void* threadpool_func(void *data) {