|| apr_socket_shutdown(csd, APR_SHUTDOWN_WRITE) != APR_SUCCESS) {
apr_socket_close(csd);
ap_push_pool(worker_queue_info, cs->p);
+ if (dying)
+ ap_queue_interrupt_one(worker_queue);
return 0;
}
return start_lingering_close_common(cs, 0);
AP_DEBUG_ASSERT(0);
}
ap_push_pool(worker_queue_info, cs->p);
+ if (dying)
+ ap_queue_interrupt_one(worker_queue);
return 0;
}
TO_QUEUE_ELEM_INIT(cs);
ap_push_pool(worker_queue_info, cs->p);
+ if (dying)
+ ap_queue_interrupt_one(worker_queue);
}
/* call 'func' for all elements of 'q' with timeout less than 'timeout_time'.
return rv;
}
-static apr_status_t queue_interrupt_all(fd_queue_t *queue, int term)
+static apr_status_t queue_interrupt(fd_queue_t *queue, int all, int term)
{
apr_status_t rv;
if (term) {
queue->terminated = 1;
}
- apr_thread_cond_broadcast(queue->not_empty);
+ if (all)
+ apr_thread_cond_broadcast(queue->not_empty);
+ else
+ apr_thread_cond_signal(queue->not_empty);
return apr_thread_mutex_unlock(queue->one_big_mutex);
}
apr_status_t ap_queue_interrupt_all(fd_queue_t * queue)
{
- return queue_interrupt_all(queue, 0);
+ return queue_interrupt(queue, 1, 0);
+}
+
+apr_status_t ap_queue_interrupt_one(fd_queue_t * queue)
+{
+ return queue_interrupt(queue, 0, 0);
}
apr_status_t ap_queue_term(fd_queue_t * queue)
{
- return queue_interrupt_all(queue, 1);
+ return queue_interrupt(queue, 1, 1);
}
event_conn_state_t ** ecs, apr_pool_t ** p,
timer_event_t ** te);
apr_status_t ap_queue_interrupt_all(fd_queue_t * queue);
+apr_status_t ap_queue_interrupt_one(fd_queue_t * queue);
apr_status_t ap_queue_term(fd_queue_t * queue);
#endif /* FDQUEUE_H */