summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_master_process.c
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2017-08-02 13:22:07 +0300
committerMax Romanov <max.romanov@nginx.com>2017-08-02 13:22:07 +0300
commitf23f985899760fafd853e993d9023b1339f09533 (patch)
treeb1896aa49683d809481351249352dbb18b59cd97 /src/nxt_master_process.c
parent021a84019f48c9027254f15c9b9db7ea12535dd0 (diff)
downloadunit-f23f985899760fafd853e993d9023b1339f09533.tar.gz
unit-f23f985899760fafd853e993d9023b1339f09533.tar.bz2
Runtime processes protected with mutex.
Diffstat (limited to 'src/nxt_master_process.c')
-rw-r--r--src/nxt_master_process.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/nxt_master_process.c b/src/nxt_master_process.c
index 2bc97c1c..41e659a4 100644
--- a/src/nxt_master_process.c
+++ b/src/nxt_master_process.c
@@ -406,7 +406,7 @@ nxt_master_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt,
port = nxt_port_new(0, 0, init->type);
if (nxt_slow_path(port == NULL)) {
- nxt_runtime_process_destroy(rt, process);
+ nxt_runtime_process_remove(rt, process);
return NXT_ERROR;
}
@@ -658,7 +658,9 @@ nxt_master_cleanup_worker_process(nxt_task_t *task, nxt_pid_t pid)
if (!nxt_exiting) {
nxt_runtime_process_each(rt, process)
{
- if (process->pid == nxt_pid) {
+ if (process->pid == nxt_pid ||
+ process->pid == pid ||
+ nxt_queue_is_empty(&process->ports)) {
continue;
}