| 309 | static int terminate_mode = ST_INIT; |
| 310 | |
| 311 | static void signal_threads(int mode) |
| 312 | { |
| 313 | if (terminate_mode == mode) { |
| 314 | return; |
| 315 | } |
| 316 | terminate_mode = mode; |
| 317 | retained->mpm->mpm_state = AP_MPMQ_STOPPING; |
| 318 | |
| 319 | /* in case we weren't called from the listener thread, wake up the |
| 320 | * listener thread |
| 321 | */ |
| 322 | wakeup_listener(); |
| 323 | |
| 324 | /* for ungraceful termination, let the workers exit now; |
| 325 | * for graceful termination, the listener thread will notify the |
| 326 | * workers to exit once it has stopped accepting new connections |
| 327 | */ |
| 328 | if (mode == ST_UNGRACEFUL) { |
| 329 | workers_may_exit = 1; |
| 330 | ap_queue_interrupt_all(worker_queue); |
| 331 | close_worker_sockets(); /* forcefully kill all current connections */ |
| 332 | } |
| 333 | |
| 334 | ap_run_child_stopping(pchild, mode == ST_GRACEFUL); |
| 335 | } |
| 336 | |
| 337 | static int worker_query(int query_code, int *result, apr_status_t *rv) |
| 338 | { |
no test coverage detected