summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_process.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-07-18 00:21:14 +0300
committerMax Romanov <max.romanov@nginx.com>2017-07-18 00:21:14 +0300
commiteb675f2d78178b2cdd54d934022f9b739bfa8952 (patch)
tree0b072c752fff35cd5c4498cded7016a5738caa58 /src/nxt_process.c
parent47b359388cdf6348238e7fc05770426448049189 (diff)
downloadunit-eb675f2d78178b2cdd54d934022f9b739bfa8952.tar.gz
unit-eb675f2d78178b2cdd54d934022f9b739bfa8952.tar.bz2
Port allocation and destroy changed. Worker process stop introduced.
Diffstat (limited to '')
-rw-r--r--src/nxt_process.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/nxt_process.c b/src/nxt_process.c
index 5899ce30..1832640d 100644
--- a/src/nxt_process.c
+++ b/src/nxt_process.c
@@ -563,30 +563,11 @@ nxt_user_cred_set(nxt_task_t *task, nxt_user_cred_t *uc)
}
-nxt_port_t *
-nxt_process_port_new(nxt_runtime_t *rt, nxt_process_t *process,
- nxt_port_id_t id, nxt_process_type_t type)
+void
+nxt_process_port_add(nxt_process_t *process, nxt_port_t *port)
{
- size_t size;
- nxt_port_t *port;
-
- size = sizeof(nxt_port_t);
- if (size == NXT_PROCESS_WORKER) {
- size += sizeof(nxt_work_t);
- }
-
- port = nxt_mp_zalloc(rt->mem_pool, size);
-
- if (nxt_fast_path(port != NULL)) {
- port->id = id;
- port->pid = process->pid;
- port->process = process;
- port->type = type;
-
- nxt_process_port_add(process, port);
- }
-
- return port;
+ port->process = process;
+ nxt_queue_insert_tail(&process->ports, &port->link);
}