comparison src/os/unix/ngx_process_cycle.c @ 571:458b6c3fea65 release-0.3.7

nginx-0.3.7-RELEASE import *) Feature: the "access_log" supports the "buffer=" parameter. *) Bugfix: nginx could not be built on platforms different from i386, amd64, sparc, and ppc; the bug had appeared in 0.3.2.
author Igor Sysoev <igor@sysoev.ru>
date Thu, 27 Oct 2005 15:46:13 +0000
parents 9c2f3ed7a247
children 58475592100c
comparison
equal deleted inserted replaced
570:2cdf120d8970 571:458b6c3fea65
274 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "worker cycle"); 274 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "worker cycle");
275 275
276 ngx_process_events_and_timers(cycle); 276 ngx_process_events_and_timers(cycle);
277 277
278 if (ngx_terminate || ngx_quit) { 278 if (ngx_terminate || ngx_quit) {
279
280 for (i = 0; ngx_modules[i]; i++) {
281 if (ngx_modules[i]->exit_process) {
282 ngx_modules[i]->exit_process(cycle);
283 }
284 }
285
279 ngx_master_exit(cycle); 286 ngx_master_exit(cycle);
280 } 287 }
281 288
282 if (ngx_reconfigure) { 289 if (ngx_reconfigure) {
283 ngx_reconfigure = 0; 290 ngx_reconfigure = 0;
621 628
622 629
623 static void 630 static void
624 ngx_master_exit(ngx_cycle_t *cycle) 631 ngx_master_exit(ngx_cycle_t *cycle)
625 { 632 {
633 ngx_uint_t i;
634
626 ngx_delete_pidfile(cycle); 635 ngx_delete_pidfile(cycle);
627 636
628 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exit"); 637 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exit");
638
639 for (i = 0; ngx_modules[i]; i++) {
640 if (ngx_modules[i]->exit_master) {
641 ngx_modules[i]->exit_master(cycle);
642 }
643 }
629 644
630 /* 645 /*
631 * we do not destroy cycle->pool here because a signal handler 646 * we do not destroy cycle->pool here because a signal handler
632 * that uses cycle->log can be called at this point 647 * that uses cycle->log can be called at this point
633 */ 648 */
732 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting"); 747 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
733 748
734 #if (NGX_THREADS) 749 #if (NGX_THREADS)
735 ngx_wakeup_worker_threads(cycle); 750 ngx_wakeup_worker_threads(cycle);
736 #endif 751 #endif
752
753 for (i = 0; ngx_modules[i]; i++) {
754 if (ngx_modules[i]->exit_process) {
755 ngx_modules[i]->exit_process(cycle);
756 }
757 }
737 758
738 c = cycle->connections; 759 c = cycle->connections;
739 for (i = 0; i < cycle->connection_n; i++) { 760 for (i = 0; i < cycle->connection_n; i++) {
740 if (c[i].fd != -1 761 if (c[i].fd != -1
741 && c[i].read 762 && c[i].read