aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_process_cycle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix/ngx_process_cycle.c')
-rw-r--r--src/os/unix/ngx_process_cycle.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 97b301459..1a5e5c420 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -792,7 +792,12 @@ static void ngx_wakeup_worker_threads(ngx_cycle_t *cycle)
for (i = 0; i < ngx_threads_n; i++) {
if (ngx_threads[i].state < NGX_THREAD_EXIT) {
ngx_cond_signal(ngx_threads[i].cv);
- live = 1;
+
+ if (ngx_threads[i].cv->tid == -1) {
+ ngx_threads[i].state = NGX_THREAD_DONE;
+ } else {
+ live = 1;
+ }
}
if (ngx_threads[i].state == NGX_THREAD_EXIT) {