summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorPaul Querna <pquerna@apache.org>2007-08-21 00:11:00 +0200
committerPaul Querna <pquerna@apache.org>2007-08-21 00:11:00 +0200
commitf03a8b36dadbbfeeb5138c701cde61450b5ffee6 (patch)
tree9a0bac698aef4f8a3a8be56394c6131dceb4ed50 /server
parentUse APR_STATUS_IS_NOTFOUND() rather than comparing against NOTFOUND directly. (diff)
downloadapache2-f03a8b36dadbbfeeb5138c701cde61450b5ffee6.tar.xz
apache2-f03a8b36dadbbfeeb5138c701cde61450b5ffee6.zip
Rework locking on timeout_mutex. We now drop (and reaquire) the lock inside the while loops. This is the least line of code changes to stop a dead lock between the queue in push2worker (a blocking function) and the timeout_mutex. These two timeout list iterations should be rewritten with better locking rules, but for now this should fix the bug, without rewriting the entire function.
PR: 41712 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@567852 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/mpm/experimental/event/event.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/mpm/experimental/event/event.c b/server/mpm/experimental/event/event.c
index febdd78b0b..abee41be8c 100644
--- a/server/mpm/experimental/event/event.c
+++ b/server/mpm/experimental/event/event.c
@@ -1076,6 +1076,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
cs->state = CONN_STATE_LINGER;
APR_RING_REMOVE(cs, timeout_list);
+ apr_thread_mutex_unlock(timeout_mutex);
rc = push2worker(&cs->pfd, event_pollset);
@@ -1088,6 +1089,7 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
*/
}
have_idle_worker = 0;
+ apr_thread_mutex_lock(timeout_mutex);
cs = APR_RING_FIRST(&keepalive_timeout_head);
}
@@ -1099,11 +1101,14 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
cs->state = CONN_STATE_LINGER;
APR_RING_REMOVE(cs, timeout_list);
+ apr_thread_mutex_unlock(timeout_mutex);
+
rc = push2worker(&cs->pfd, event_pollset);
if (rc != APR_SUCCESS) {
return NULL;
}
have_idle_worker = 0;
+ apr_thread_mutex_lock(timeout_mutex);
cs = APR_RING_FIRST(&timeout_head);
}