diff --git a/include/lighttpd/waitqueue.h b/include/lighttpd/waitqueue.h index 85395d89..ae6a1902 100644 --- a/include/lighttpd/waitqueue.h +++ b/include/lighttpd/waitqueue.h @@ -34,7 +34,7 @@ struct liWaitQueue { */ /* initializes a waitqueue by creating the timer and initializing the queue. precision is sub-seconds */ -LI_API void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, liWaitQueueCB callback, gdouble delay, gpointer data); +LI_API void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, const char *waitqueue_name, liWaitQueueCB callback, gdouble delay, gpointer data); /* stops the waitqueue. to restart it, simply call li_waitqueue_update */ LI_API void li_waitqueue_stop(liWaitQueue *queue); diff --git a/src/common/waitqueue.c b/src/common/waitqueue.c index 81c824a1..ba5b5ad4 100644 --- a/src/common/waitqueue.c +++ b/src/common/waitqueue.c @@ -8,8 +8,8 @@ static void wq_cb(liEventBase *watcher, int events) { queue->callback(queue, queue->data); } -void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, liWaitQueueCB callback, gdouble delay, gpointer data) { - li_event_timer_init(loop, "waitqueue", &queue->timer, wq_cb); +void li_waitqueue_init(liWaitQueue *queue, liEventLoop *loop, const char *waitqueue_name, liWaitQueueCB callback, gdouble delay, gpointer data) { + li_event_timer_init(loop, waitqueue_name, &queue->timer, wq_cb); queue->head = queue->tail = NULL; queue->delay = delay; diff --git a/src/main/backends.c b/src/main/backends.c index 77502b35..c0cfbe08 100644 --- a/src/main/backends.c +++ b/src/main/backends.c @@ -775,12 +775,12 @@ static gpointer backend_pool_worker_init(liWorker *wrk, gpointer fdata) { if (wpool->initialized) return NULL; - li_event_async_init(&wrk->loop, "backend pool", &wpool->wakeup, backend_pool_worker_run); + li_event_async_init(&wrk->loop, "backend manager", &wpool->wakeup, backend_pool_worker_run); if (idle_timeout < 1) idle_timeout = 5; - li_waitqueue_init(&wpool->idle_queue, &wrk->loop, backend_pool_worker_idle_timeout, idle_timeout, wpool); - li_waitqueue_init(&wpool->connect_queue, &wrk->loop, backend_pool_worker_connect_timeout, pool->public.config->connect_timeout, wpool); + li_waitqueue_init(&wpool->idle_queue, &wrk->loop, "backend idle queue", backend_pool_worker_idle_timeout, idle_timeout, wpool); + li_waitqueue_init(&wpool->connect_queue, &wrk->loop, "backend connect queue", backend_pool_worker_connect_timeout, pool->public.config->connect_timeout, wpool); - li_event_timer_init(&wrk->loop, "backend pool", &wpool->wait_queue_timer, backend_pool_wait_queue_timeout); + li_event_timer_init(&wrk->loop, "backend wait timeout", &wpool->wait_queue_timer, backend_pool_wait_queue_timeout); li_event_set_keep_loop_alive(&wpool->wait_queue_timer, FALSE); wpool->initialized = TRUE; diff --git a/src/main/log.c b/src/main/log.c index 2b06c762..d62796a2 100644 --- a/src/main/log.c +++ b/src/main/log.c @@ -110,7 +110,7 @@ void li_log_init(liServer *srv) { li_event_loop_init(&srv->logs.loop, ev_loop_new(EVFLAG_AUTO)); li_event_async_init(&srv->logs.loop, "log", &srv->logs.watcher, log_watcher_cb); srv->logs.targets = li_radixtree_new(); - li_waitqueue_init(&srv->logs.close_queue, &srv->logs.loop, log_close_cb, LOG_DEFAULT_TTL, srv); + li_waitqueue_init(&srv->logs.close_queue, &srv->logs.loop, "log close queue", log_close_cb, LOG_DEFAULT_TTL, srv); srv->logs.timestamp.format = g_string_new_len(CONST_STR_LEN(LOG_DEFAULT_TS_FORMAT)); srv->logs.timestamp.cached = g_string_sized_new(255); srv->logs.timestamp.last_ts = 0; diff --git a/src/main/stat_cache.c b/src/main/stat_cache.c index 4c695155..8d5998c2 100644 --- a/src/main/stat_cache.c +++ b/src/main/stat_cache.c @@ -25,7 +25,7 @@ liStatCache* li_stat_cache_new(liWorker *wrk, gdouble ttl) { sc->entries = g_hash_table_new_full((GHashFunc)g_string_hash, (GEqualFunc)g_string_equal, NULL, NULL); sc->dirlists = g_hash_table_new_full((GHashFunc)g_string_hash, (GEqualFunc)g_string_equal, NULL, NULL); - li_waitqueue_init(&sc->delete_queue, &wrk->loop, stat_cache_delete_cb, ttl, sc); + li_waitqueue_init(&sc->delete_queue, &wrk->loop, "stat cache delete queue", stat_cache_delete_cb, ttl, sc); return sc; } diff --git a/src/main/worker.c b/src/main/worker.c index f22cd569..330c0b42 100644 --- a/src/main/worker.c +++ b/src/main/worker.c @@ -324,10 +324,10 @@ liWorker* li_worker_new(liServer *srv, struct ev_loop *loop) { wrk->collect_queue = g_async_queue_new(); /* io timeout timer */ - li_waitqueue_init(&wrk->io_timeout_queue, &wrk->loop, worker_io_timeout_cb, srv->io_timeout, wrk); + li_waitqueue_init(&wrk->io_timeout_queue, &wrk->loop, "io timeout queue", worker_io_timeout_cb, srv->io_timeout, wrk); /* throttling */ - li_waitqueue_init(&wrk->throttle_queue, &wrk->loop, li_throttle_waitqueue_cb, ((gdouble)LI_THROTTLE_GRANULARITY) / 1000, wrk); + li_waitqueue_init(&wrk->throttle_queue, &wrk->loop, "throttle queue", li_throttle_waitqueue_cb, ((gdouble)LI_THROTTLE_GRANULARITY) / 1000, wrk); wrk->tasklets = li_tasklet_pool_new(&wrk->loop, srv->tasklet_pool_threads); diff --git a/src/modules/mod_limit.c b/src/modules/mod_limit.c index 8925cabf..26ec5192 100644 --- a/src/modules/mod_limit.c +++ b/src/modules/mod_limit.c @@ -417,7 +417,7 @@ static void mod_limit_prepare_worker(liServer *srv, liPlugin *p, liWorker *wrk) mld = p->data; } - li_waitqueue_init(&(mld->timeout_queues[wrk->ndx]), &wrk->loop, mod_limit_timeout_callback, 1.0, NULL); + li_waitqueue_init(&(mld->timeout_queues[wrk->ndx]), &wrk->loop, "mod_limit timeout queue", mod_limit_timeout_callback, 1.0, NULL); } static void plugin_limit_free(liServer *srv, liPlugin *p) { diff --git a/src/modules/mod_progress.c b/src/modules/mod_progress.c index 1b1a0277..8b8edbcf 100644 --- a/src/modules/mod_progress.c +++ b/src/modules/mod_progress.c @@ -454,7 +454,7 @@ static void progress_prepare(liServer *srv, liPlugin *p) { pd->worker_data[i].pd = pd; pd->worker_data[i].wrk_ndx = i; pd->worker_data[i].hash_table = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, progress_hashtable_free_callback); - li_waitqueue_init(&(pd->worker_data[i].timeout_queue), &wrk->loop, progress_timeout_callback, pd->ttl, &pd->worker_data[i]); + li_waitqueue_init(&(pd->worker_data[i].timeout_queue), &wrk->loop, "mod_progress cleanup queue", progress_timeout_callback, pd->ttl, &pd->worker_data[i]); } }