summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-06-23 19:19:41 +0300
committerMax Romanov <max.romanov@nginx.com>2017-06-23 19:19:41 +0300
commite5fe254e1e741f24d53f5199cc4f187efd6a9924 (patch)
tree181f9da2aa94db48c665868fa3291b2fa1de2b03
parent89ab9a9d054f6bca745cbd91cffa9572672a7110 (diff)
downloadunit-e5fe254e1e741f24d53f5199cc4f187efd6a9924.tar.gz
unit-e5fe254e1e741f24d53f5199cc4f187efd6a9924.tar.bz2
nxt_port_create() use task instead of thread.
Write socket close() call moved out from nxt_port_create().
Diffstat (limited to '')
-rw-r--r--src/nxt_port.c7
-rw-r--r--src/nxt_port.h2
-rw-r--r--src/nxt_process.c3
3 files changed, 6 insertions, 6 deletions
diff --git a/src/nxt_port.c b/src/nxt_port.c
index e23db689..fb4d65a6 100644
--- a/src/nxt_port.c
+++ b/src/nxt_port.c
@@ -15,16 +15,15 @@ static void nxt_port_new_port_buf_completion(nxt_task_t *task, void *obj,
void
-nxt_port_create(nxt_thread_t *thread, nxt_port_t *port,
+nxt_port_create(nxt_task_t *task, nxt_port_t *port,
nxt_port_handler_t *handlers)
{
port->pid = nxt_pid;
- port->engine = thread->engine->id;
+ port->engine = task->thread->engine->id;
port->handler = nxt_port_handler;
port->data = handlers;
- nxt_port_write_close(port);
- nxt_port_read_enable(&thread->engine->task, port);
+ nxt_port_read_enable(task, port);
}
diff --git a/src/nxt_port.h b/src/nxt_port.h
index 28b10557..48e326ee 100644
--- a/src/nxt_port.h
+++ b/src/nxt_port.h
@@ -110,7 +110,7 @@ nxt_int_t nxt_port_socket_write(nxt_task_t *task, nxt_port_t *port,
nxt_uint_t type, nxt_fd_t fd, uint32_t stream, nxt_port_id_t reply_port,
nxt_buf_t *b);
-void nxt_port_create(nxt_thread_t *thread, nxt_port_t *port,
+void nxt_port_create(nxt_task_t *task, nxt_port_t *port,
nxt_port_handler_t *handlers);
void nxt_port_write(nxt_task_t *task, nxt_runtime_t *rt, nxt_uint_t type,
nxt_fd_t fd, uint32_t stream, nxt_buf_t *b);
diff --git a/src/nxt_process.c b/src/nxt_process.c
index ac294dba..b8414b93 100644
--- a/src/nxt_process.c
+++ b/src/nxt_process.c
@@ -100,7 +100,8 @@ nxt_process_start(nxt_task_t *task, nxt_process_init_t *process)
nxt_port_write_enable(task, process->master_port);
/* A worker process port. */
- nxt_port_create(thread, process->port, process->port_handlers);
+ nxt_port_write_close(process->port);
+ nxt_port_create(task, process->port, process->port_handlers);
ret = nxt_runtime_thread_pool_create(thread, rt, rt->auxiliary_threads,
60000 * 1000000LL);