MCPcopy Create free account
hub / github.com/apache/httpd / signal_threads

Function signal_threads

server/mpm/worker/worker.c:311–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309static int terminate_mode = ST_INIT;
310
311static 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
337static int worker_query(int query_code, int *result, apr_status_t *rv)
338{

Callers 5

check_infinite_requestsFunction · 0.70
accept_mutex_errorFunction · 0.70
listener_threadFunction · 0.70
worker_threadFunction · 0.70
child_mainFunction · 0.70

Calls 3

ap_queue_interrupt_allFunction · 0.85
wakeup_listenerFunction · 0.70
close_worker_socketsFunction · 0.70

Tested by

no test coverage detected