the mutex-protected critical path of ap_queue_pop()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94828
13f79535-47bb-0310-9956-
ffa450edef68
{
fd_queue_elem_t *elem;
apr_status_t rv;
+ int delete_pool = 0;
if ((rv = apr_thread_mutex_lock(queue->one_big_mutex)) != APR_SUCCESS) {
if (recycled_pool) {
queue->recycled_pools[queue->num_recycled++] = recycled_pool;
}
else {
- apr_pool_destroy(recycled_pool);
+ delete_pool = 1;
}
}
/* If we wake up and it's still empty, then we were interrupted */
if (ap_queue_empty(queue)) {
if ((rv = apr_thread_mutex_unlock(queue->one_big_mutex)) != APR_SUCCESS) {
+ if (delete_pool) {
+ apr_pool_destroy(recycled_pool);
+ }
return rv;
}
+ if (delete_pool) {
+ apr_pool_destroy(recycled_pool);
+ }
if (queue->terminated) {
return APR_EOF; /* no more elements ever again */
}