comparison src/os/unix/ngx_process_cycle.c @ 518:86dad910eeb6 NGINX_0_8_11

nginx 0.8.11 *) Change: directive "gzip_disable msie6" enables gzipping for MSIE 6.0 SV1. *) Feature: file AIO support on FreeBSD and Linux. *) Feature: the "directio_alignment" directive.
author Igor Sysoev <http://sysoev.ru>
date Fri, 28 Aug 2009 00:00:00 +0400
parents 7efcdb937752
children 1dcf6adad484
comparison
equal deleted inserted replaced
517:15b5cddc5190 518:86dad910eeb6
35 ngx_pid_t ngx_pid; 35 ngx_pid_t ngx_pid;
36 ngx_uint_t ngx_threaded; 36 ngx_uint_t ngx_threaded;
37 37
38 sig_atomic_t ngx_reap; 38 sig_atomic_t ngx_reap;
39 sig_atomic_t ngx_sigio; 39 sig_atomic_t ngx_sigio;
40 sig_atomic_t ngx_sigalrm;
40 sig_atomic_t ngx_terminate; 41 sig_atomic_t ngx_terminate;
41 sig_atomic_t ngx_quit; 42 sig_atomic_t ngx_quit;
42 sig_atomic_t ngx_debug_quit; 43 sig_atomic_t ngx_debug_quit;
43 ngx_uint_t ngx_exiting; 44 ngx_uint_t ngx_exiting;
44 sig_atomic_t ngx_reconfigure; 45 sig_atomic_t ngx_reconfigure;
140 delay = 0; 141 delay = 0;
141 live = 1; 142 live = 1;
142 143
143 for ( ;; ) { 144 for ( ;; ) {
144 if (delay) { 145 if (delay) {
145 delay *= 2; 146 if (ngx_sigalrm) {
147 delay *= 2;
148 ngx_sigalrm = 0;
149 }
146 150
147 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0, 151 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
148 "temination cycle: %d", delay); 152 "termination cycle: %d", delay);
149 153
150 itv.it_interval.tv_sec = 0; 154 itv.it_interval.tv_sec = 0;
151 itv.it_interval.tv_usec = 0; 155 itv.it_interval.tv_usec = 0;
152 itv.it_value.tv_sec = delay / 1000; 156 itv.it_value.tv_sec = delay / 1000;
153 itv.it_value.tv_usec = (delay % 1000 ) * 1000; 157 itv.it_value.tv_usec = (delay % 1000 ) * 1000;
512 "kill (%P, %d)" , ngx_processes[i].pid, signo); 516 "kill (%P, %d)" , ngx_processes[i].pid, signo);
513 517
514 if (kill(ngx_processes[i].pid, signo) == -1) { 518 if (kill(ngx_processes[i].pid, signo) == -1) {
515 err = ngx_errno; 519 err = ngx_errno;
516 ngx_log_error(NGX_LOG_ALERT, cycle->log, err, 520 ngx_log_error(NGX_LOG_ALERT, cycle->log, err,
517 "kill(%P, %d) failed", 521 "kill(%P, %d) failed", ngx_processes[i].pid, signo);
518 ngx_processes[i].pid, signo);
519 522
520 if (err == NGX_ESRCH) { 523 if (err == NGX_ESRCH) {
521 ngx_processes[i].exited = 1; 524 ngx_processes[i].exited = 1;
522 ngx_processes[i].exiting = 0; 525 ngx_processes[i].exiting = 0;
523 ngx_reap = 1; 526 ngx_reap = 1;