summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_thread_pool.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-07-14 20:34:43 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-07-14 20:34:43 +0300
commite134efcb9caf5f95d0e750a9af8a9d403aa131af (patch)
tree68b23965539359e9eed48a965c14b94b5edd0cd5 /src/nxt_thread_pool.c
parentb3464d563e699814d833d6ddf327d70660ddee6b (diff)
downloadunit-e134efcb9caf5f95d0e750a9af8a9d403aa131af.tar.gz
unit-e134efcb9caf5f95d0e750a9af8a9d403aa131af.tar.bz2
Thread pools: various fixes.
Diffstat (limited to 'src/nxt_thread_pool.c')
-rw-r--r--src/nxt_thread_pool.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nxt_thread_pool.c b/src/nxt_thread_pool.c
index c8959dc6..56efa1a0 100644
--- a/src/nxt_thread_pool.c
+++ b/src/nxt_thread_pool.c
@@ -83,7 +83,7 @@ nxt_thread_pool_init(nxt_thread_pool_t *tp)
if (nxt_fast_path(nxt_sem_init(&tp->sem, 0) == NXT_OK)) {
- link = nxt_malloc(sizeof(nxt_thread_link_t));
+ link = nxt_zalloc(sizeof(nxt_thread_link_t));
if (nxt_fast_path(link != NULL)) {
link->start = nxt_thread_pool_start;
@@ -237,7 +237,7 @@ nxt_thread_pool_destroy(nxt_thread_pool_t *tp)
if (!tp->ready) {
nxt_work_queue_add(&thr->engine->fast_work_queue, tp->exit,
- &tp->task, tp, NULL);
+ &tp->engine->task, tp, NULL);
return;
}
@@ -296,7 +296,7 @@ nxt_thread_pool_exit(nxt_task_t *task, void *obj, void *data)
nxt_sem_destroy(&tp->sem);
- nxt_work_set(&tp->work, nxt_thread_pool_exit, &tp->task, tp,
+ nxt_work_set(&tp->work, tp->exit, &tp->engine->task, tp,
(void *) (uintptr_t) thread->handle);
nxt_event_engine_post(tp->engine, &tp->work);