diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-11-23 18:46:21 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-11-23 18:46:21 +0300 |
commit | 72db760eca850562cc89c550c6cf9f54d657f532 (patch) | |
tree | af6ddc31736caa6dcf4327fd8990aa1ccfab4f41 | |
parent | 8019121120853dbdab475ec9091f0aeb2aad7bbb (diff) |
add NGX_PROCESS_HELPER process status
-rw-r--r-- | src/core/ngx_connection.c | 2 | ||||
-rw-r--r-- | src/event/modules/ngx_poll_module.c | 2 | ||||
-rw-r--r-- | src/event/modules/ngx_select_module.c | 2 | ||||
-rw-r--r-- | src/event/modules/ngx_win32_select_module.c | 2 | ||||
-rw-r--r-- | src/os/unix/ngx_process.c | 1 | ||||
-rw-r--r-- | src/os/unix/ngx_process_cycle.c | 6 | ||||
-rw-r--r-- | src/os/unix/ngx_process_cycle.h | 5 | ||||
-rw-r--r-- | src/os/win32/ngx_process.h | 5 | ||||
-rw-r--r-- | src/os/win32/ngx_process_cycle.h | 4 |
9 files changed, 14 insertions, 15 deletions
diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c index 3bd9cc676..9a9023699 100644 --- a/src/core/ngx_connection.c +++ b/src/core/ngx_connection.c @@ -634,7 +634,7 @@ ngx_close_listening_sockets(ngx_cycle_t *cycle) #if (NGX_HAVE_UNIX_DOMAIN) if (ls[i].sockaddr->sa_family == AF_UNIX - && ngx_process != NGX_PROCESS_WORKER + && ngx_process <= NGX_PROCESS_MASTER && ngx_new_binary == 0) { u_char *name = ls[i].addr_text.data + sizeof("unix:") - 1; diff --git a/src/event/modules/ngx_poll_module.c b/src/event/modules/ngx_poll_module.c index e45942b91..10098d61e 100644 --- a/src/event/modules/ngx_poll_module.c +++ b/src/event/modules/ngx_poll_module.c @@ -72,7 +72,7 @@ ngx_poll_init(ngx_cycle_t *cycle, ngx_msec_t timer) nevents = 0; } - if (ngx_process == NGX_PROCESS_WORKER + if (ngx_process >= NGX_PROCESS_WORKER || cycle->old_cycle == NULL || cycle->old_cycle->connection_n < cycle->connection_n) { diff --git a/src/event/modules/ngx_select_module.c b/src/event/modules/ngx_select_module.c index 5d00ecfb9..e76da5b9f 100644 --- a/src/event/modules/ngx_select_module.c +++ b/src/event/modules/ngx_select_module.c @@ -81,7 +81,7 @@ ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer) nevents = 0; } - if (ngx_process == NGX_PROCESS_WORKER + if (ngx_process >= NGX_PROCESS_WORKER || cycle->old_cycle == NULL || cycle->old_cycle->connection_n < cycle->connection_n) { diff --git a/src/event/modules/ngx_win32_select_module.c b/src/event/modules/ngx_win32_select_module.c index bfcc0e2e5..8c22f397a 100644 --- a/src/event/modules/ngx_win32_select_module.c +++ b/src/event/modules/ngx_win32_select_module.c @@ -82,7 +82,7 @@ ngx_select_init(ngx_cycle_t *cycle, ngx_msec_t timer) nevents = 0; } - if (ngx_process == NGX_PROCESS_WORKER + if (ngx_process >= NGX_PROCESS_WORKER || cycle->old_cycle == NULL || cycle->old_cycle->connection_n < cycle->connection_n) { diff --git a/src/os/unix/ngx_process.c b/src/os/unix/ngx_process.c index 48ba9d4db..f140d629b 100644 --- a/src/os/unix/ngx_process.c +++ b/src/os/unix/ngx_process.c @@ -388,6 +388,7 @@ ngx_signal_handler(int signo) break; case NGX_PROCESS_WORKER: + case NGX_PROCESS_HELPER: switch (signo) { case ngx_signal_value(NGX_NOACCEPT_SIGNAL): diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c index e203ea3c9..06e020e06 100644 --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -714,6 +714,8 @@ ngx_worker_process_cycle(ngx_cycle_t *cycle, void *data) ngx_uint_t i; ngx_connection_t *c; + ngx_process = NGX_PROCESS_WORKER; + ngx_worker_process_init(cycle, 1); ngx_setproctitle("worker process"); @@ -829,8 +831,6 @@ ngx_worker_process_init(ngx_cycle_t *cycle, ngx_uint_t priority) ngx_core_conf_t *ccf; ngx_listening_t *ls; - ngx_process = NGX_PROCESS_WORKER; - if (ngx_set_environment(cycle, NULL) == NULL) { /* fatal */ exit(2); @@ -1289,6 +1289,8 @@ ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data) cycle->connection_n = 512; + ngx_process = NGX_PROCESS_HELPER; + ngx_worker_process_init(cycle, 0); ngx_close_listening_sockets(cycle); diff --git a/src/os/unix/ngx_process_cycle.h b/src/os/unix/ngx_process_cycle.h index f46ad463f..e6cef6b3f 100644 --- a/src/os/unix/ngx_process_cycle.h +++ b/src/os/unix/ngx_process_cycle.h @@ -21,8 +21,9 @@ #define NGX_PROCESS_SINGLE 0 #define NGX_PROCESS_MASTER 1 -#define NGX_PROCESS_WORKER 2 -#define NGX_PROCESS_SIGNALLER 3 +#define NGX_PROCESS_SIGNALLER 2 +#define NGX_PROCESS_WORKER 3 +#define NGX_PROCESS_HELPER 4 typedef struct { diff --git a/src/os/win32/ngx_process.h b/src/os/win32/ngx_process.h index edcde3918..55f5648ee 100644 --- a/src/os/win32/ngx_process.h +++ b/src/os/win32/ngx_process.h @@ -48,11 +48,6 @@ typedef struct { } ngx_exec_ctx_t; -#define NGX_PROCESS_SINGLE 0 -#define NGX_PROCESS_MASTER 1 -#define NGX_PROCESS_WORKER 2 - - ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle, char *name, ngx_int_t respawn); ngx_pid_t ngx_execute(ngx_cycle_t *cycle, ngx_exec_ctx_t *ctx); diff --git a/src/os/win32/ngx_process_cycle.h b/src/os/win32/ngx_process_cycle.h index cd5f01199..aaa4ba383 100644 --- a/src/os/win32/ngx_process_cycle.h +++ b/src/os/win32/ngx_process_cycle.h @@ -14,8 +14,8 @@ #define NGX_PROCESS_SINGLE 0 #define NGX_PROCESS_MASTER 1 -#define NGX_PROCESS_WORKER 2 -#define NGX_PROCESS_SIGNALLER 3 +#define NGX_PROCESS_SIGNALLER 2 +#define NGX_PROCESS_WORKER 3 void ngx_master_process_cycle(ngx_cycle_t *cycle); |