From 91aefd5c8fa1168cff67bbf5b6933f50ed4cf4b6 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sun, 28 Apr 2002 04:48:43 +0000 Subject: [PATCH] Added a missing pool deletion case and simplified the conditionals for the error-case return (thanks to Justin for suggesting the latter) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94829 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/worker/fdqueue.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/server/mpm/worker/fdqueue.c b/server/mpm/worker/fdqueue.c index 673a3927a1..a7f9bc2857 100644 --- a/server/mpm/worker/fdqueue.c +++ b/server/mpm/worker/fdqueue.c @@ -311,15 +311,13 @@ apr_status_t ap_queue_pop(fd_queue_t *queue, apr_socket_t **sd, apr_pool_t **p, } /* 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; - } + rv = apr_thread_mutex_unlock(queue->one_big_mutex); if (delete_pool) { apr_pool_destroy(recycled_pool); } + if (rv != APR_SUCCESS) { + return rv; + } if (queue->terminated) { return APR_EOF; /* no more elements ever again */ } @@ -342,11 +340,11 @@ apr_status_t ap_queue_pop(fd_queue_t *queue, apr_socket_t **sd, apr_pool_t **p, apr_thread_cond_signal(queue->not_full); } - if ((rv = apr_thread_mutex_unlock(queue->one_big_mutex)) != APR_SUCCESS) { - return rv; + rv = apr_thread_mutex_unlock(queue->one_big_mutex); + if (delete_pool) { + apr_pool_destroy(recycled_pool); } - - return APR_SUCCESS; + return rv; } apr_status_t ap_queue_interrupt_all(fd_queue_t *queue) -- 2.40.0