src/server/util/thrpool.c

changeset 581
4a049e416021
parent 577
4f5ccaea4a92
equal deleted inserted replaced
580:315c625bf141 581:4a049e416021
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;

mercurial