nxt_process_create() changed to add process to runtime before callbacks.

This commit is contained in:
Max Romanov
2017-06-23 19:19:41 +03:00
parent e5fe254e1e
commit ac43bfcc72
3 changed files with 21 additions and 16 deletions

View File

@@ -244,7 +244,7 @@ nxt_master_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt,
port->engine = 0;
port->type = init->type;
pid = nxt_process_create(task, init);
pid = nxt_process_create(task, process);
switch (pid) {
@@ -253,19 +253,10 @@ nxt_master_create_worker_process(nxt_task_t *task, nxt_runtime_t *rt,
case 0:
/* A worker process, return to the event engine work queue loop. */
process->pid = nxt_pid;
port->pid = nxt_pid;
nxt_runtime_process_add(rt, process);
return NXT_AGAIN;
default:
/* The master process created a new process. */
process->pid = pid;
port->pid = pid;
nxt_runtime_process_add(rt, process);
nxt_port_read_close(port);
nxt_port_write_enable(task, port);