| 36 static threadpool_job kill_job; |
36 static threadpool_job kill_job; |
| 37 |
37 |
| 38 threadpool_t* threadpool_new(int min, int max) { |
38 threadpool_t* threadpool_new(int min, int max) { |
| 39 log_ereport(LOG_INFORM, "new threadpool (min: %d, max: %d)", min, max); |
39 log_ereport(LOG_INFORM, "new threadpool (min: %d, max: %d)", min, max); |
| 40 threadpool_t *pool = malloc(sizeof(threadpool_t)); |
40 threadpool_t *pool = malloc(sizeof(threadpool_t)); |
| |
41 memset(pool, 0, sizeof(threadpool_t)); |
| 41 pool->queue = NULL; |
42 pool->queue = NULL; |
| 42 pool->queue_len = 0; |
43 pool->queue_len = 0; |
| 43 pool->num_idle = 0; |
44 pool->num_idle = 0; |
| 44 pool->min_threads = min; |
45 pool->min_threads = min; |
| 45 pool->max_threads = max; |
46 pool->max_threads = max; |