Mercurial > hg > nginx
comparison src/os/win32/ngx_process_cycle.c @ 6929:3069dd358ba2
Cancelable timers are now preserved if there are other timers.
There is no need to cancel timers early if there are other timers blocking
shutdown anyway. Preserving such timers allows nginx to continue some
periodic work till the shutdown is actually possible.
With the new approach, timers with ev->cancelable are simply ignored when
checking if there are any timers left during shutdown.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 07 Mar 2017 18:51:15 +0300 |
parents | ca709bca4b77 |
children | 97c99bb43737 |
comparison
equal
deleted
inserted
replaced
6928:e0cc454aafe4 | 6929:3069dd358ba2 |
---|---|
780 } | 780 } |
781 | 781 |
782 while (!ngx_quit) { | 782 while (!ngx_quit) { |
783 | 783 |
784 if (ngx_exiting) { | 784 if (ngx_exiting) { |
785 ngx_event_cancel_timers(); | 785 if (ngx_event_no_timers_left() == NGX_OK) { |
786 | |
787 if (ngx_event_timer_rbtree.root | |
788 == ngx_event_timer_rbtree.sentinel) | |
789 { | |
790 break; | 786 break; |
791 } | 787 } |
792 } | 788 } |
793 | 789 |
794 ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "worker cycle"); | 790 ngx_log_debug0(NGX_LOG_DEBUG_CORE, cycle->log, 0, "worker cycle"); |