summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_event_conn.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-01-27 11:35:11 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-01-27 11:35:11 +0300
commitba0391577b06446307fa073f856f57748557e0dd (patch)
treeb2b871a041edee242662c95197bed292531c3a9a /src/nxt_event_conn.c
parent6886b83c1f3bfdc514d58ad6e9ab40873cafcb54 (diff)
downloadunit-ba0391577b06446307fa073f856f57748557e0dd.tar.gz
unit-ba0391577b06446307fa073f856f57748557e0dd.tar.bz2
Work queues refactoring.
Diffstat (limited to '')
-rw-r--r--src/nxt_event_conn.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/nxt_event_conn.c b/src/nxt_event_conn.c
index 6c4fa949..913038f1 100644
--- a/src/nxt_event_conn.c
+++ b/src/nxt_event_conn.c
@@ -85,8 +85,8 @@ nxt_event_conn_create(nxt_mem_pool_t *mp, nxt_log_t *log)
c->max_chunk = NXT_INT32_T_MAX;
c->sendfile = NXT_CONN_SENDFILE_UNSET;
- c->socket.read_work_queue = &thr->work_queue.main;
- c->socket.write_work_queue = &thr->work_queue.main;
+ c->socket.read_work_queue = &thr->engine->fast_work_queue;
+ c->socket.write_work_queue = &thr->engine->fast_work_queue;
nxt_event_conn_timer_init(&c->read_timer, c, c->socket.read_work_queue);
nxt_event_conn_timer_init(&c->write_timer, c, c->socket.write_work_queue);
@@ -143,10 +143,6 @@ nxt_event_conn_close(nxt_task_t *task, nxt_event_conn_t *c)
thr = task->thread;
- nxt_thread_work_queue_drop(thr, c);
- nxt_thread_work_queue_drop(thr, &c->read_timer);
- nxt_thread_work_queue_drop(thr, &c->write_timer);
-
engine = thr->engine;
nxt_event_timer_delete(engine, &c->read_timer);
@@ -168,8 +164,8 @@ nxt_event_conn_close(nxt_task_t *task, nxt_event_conn_t *c)
handler = nxt_event_conn_shutdown_socket;
}
- nxt_thread_work_queue_add(thr, wq, handler, task,
- (void *) (uintptr_t) c->socket.fd, NULL);
+ nxt_work_queue_add(wq, handler, task,
+ (void *) (uintptr_t) c->socket.fd, NULL);
} else {
nxt_socket_close(c->socket.fd);
@@ -188,10 +184,9 @@ nxt_event_conn_shutdown_socket(nxt_task_t *task, void *obj, void *data)
nxt_socket_shutdown(s, SHUT_RDWR);
- nxt_thread_work_queue_add(task->thread,
- &task->thread->engine->close_work_queue,
- nxt_event_conn_close_socket, task,
- (void *) (uintptr_t) s, NULL);
+ nxt_work_queue_add(&task->thread->engine->close_work_queue,
+ nxt_event_conn_close_socket, task,
+ (void *) (uintptr_t) s, NULL);
}