mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 09:42:39 +08:00
Win32: fixed cpu hog by cache manager on exit (ticket #514).
The "ngx_quit" may be reset by the worker thread before it's seen by a ngx_cache_manager_thread(), resulting in an infinite loop. Make sure to test ngx_exiting as well.
This commit is contained in:
parent
e042fc9038
commit
8f6958baa9
@ -926,7 +926,7 @@ ngx_cache_manager_thread(void *data)
|
|||||||
* ev == WAIT_ABANDONED_0 + 1
|
* ev == WAIT_ABANDONED_0 + 1
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (ngx_terminate || ngx_quit) {
|
if (ngx_terminate || ngx_quit || ngx_exiting) {
|
||||||
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
|
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -936,7 +936,7 @@ ngx_cache_manager_thread(void *data)
|
|||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
|
|
||||||
if (ngx_terminate || ngx_quit) {
|
if (ngx_terminate || ngx_quit || ngx_exiting) {
|
||||||
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
|
ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exiting");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1005,7 +1005,7 @@ ngx_cache_loader_thread(void *data)
|
|||||||
path = cycle->paths.elts;
|
path = cycle->paths.elts;
|
||||||
for (i = 0; i < cycle->paths.nelts; i++) {
|
for (i = 0; i < cycle->paths.nelts; i++) {
|
||||||
|
|
||||||
if (ngx_terminate || ngx_quit) {
|
if (ngx_terminate || ngx_quit || ngx_exiting) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user