diff options
author | Igor Sysoev <igor@sysoev.ru> | 2017-05-31 15:26:45 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2017-05-31 15:26:45 +0300 |
commit | 5bc011afad76fe7576ef0e0ed7ca7eb5417cf338 (patch) | |
tree | 0db06be61c62ecabb5225f69688da8ab4424aa36 /src/nxt_thread.c | |
parent | dee819daabe6e7ab462beac779ab0dfd7d648844 (diff) | |
download | unit-5bc011afad76fe7576ef0e0ed7ca7eb5417cf338.tar.gz unit-5bc011afad76fe7576ef0e0ed7ca7eb5417cf338.tar.bz2 |
Skeleton of router configuration and request processing.
Diffstat (limited to 'src/nxt_thread.c')
-rw-r--r-- | src/nxt_thread.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/nxt_thread.c b/src/nxt_thread.c index 78c6f50c..851ebb4f 100644 --- a/src/nxt_thread.c +++ b/src/nxt_thread.c @@ -114,9 +114,9 @@ nxt_thread_trampoline(void *data) pthread_cleanup_push(nxt_thread_time_cleanup, thr); start = link->start; - data = link->data; + data = link->work.data; - if (link->engine != NULL) { + if (link->work.handler != NULL) { thr->link = link; } else { @@ -180,7 +180,8 @@ nxt_thread_time_cleanup(void *data) void nxt_thread_exit(nxt_thread_t *thr) { - nxt_thread_link_t *link; + nxt_thread_link_t *link; + nxt_event_engine_t *engine; nxt_log_debug(thr->log, "thread exit"); @@ -189,13 +190,14 @@ nxt_thread_exit(nxt_thread_t *thr) if (link != NULL) { /* - * link->handler is already set to an exit handler, - * and link->task is already set to engine->task. + * link->work.handler is already set to an exit handler, + * and link->work.task is already set to the correct engine->task. * The link should be freed by the exit handler. */ link->work.obj = (void *) (uintptr_t) thr->handle; + engine = nxt_container_of(link->work.task, nxt_event_engine_t, task); - nxt_event_engine_post(link->engine, &link->work); + nxt_event_engine_post(engine, &link->work); } nxt_thread_time_free(thr); |