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

Function queue_interrupt

server/mpm_fdqueue.c:492–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

490}
491
492static apr_status_t queue_interrupt(fd_queue_t *queue, int all, int term)
493{
494 apr_status_t rv;
495
496 if (queue->terminated) {
497 return APR_EOF;
498 }
499
500 if ((rv = apr_thread_mutex_lock(queue->one_big_mutex)) != APR_SUCCESS) {
501 return rv;
502 }
503
504 /* we must hold one_big_mutex when setting this... otherwise,
505 * we could end up setting it and waking everybody up just after a
506 * would-be popper checks it but right before they block
507 */
508 if (term) {
509 queue->terminated = 1;
510 }
511 if (all)
512 apr_thread_cond_broadcast(queue->not_empty);
513 else
514 apr_thread_cond_signal(queue->not_empty);
515
516 return apr_thread_mutex_unlock(queue->one_big_mutex);
517}
518
519apr_status_t ap_queue_interrupt_all(fd_queue_t *queue)
520{

Callers 3

ap_queue_interrupt_allFunction · 0.85
ap_queue_interrupt_oneFunction · 0.85
ap_queue_termFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected