| 490 | } |
| 491 | |
| 492 | static 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 | |
| 519 | apr_status_t ap_queue_interrupt_all(fd_queue_t *queue) |
| 520 | { |
no outgoing calls
no test coverage detected