1
#! /bin/sh /usr/share/dpatch/dpatch-run
3
## All lines beginning with `## DP:' are a description of the patch.
4
## DP:see http://svn.apache.org/viewvc?view=rev&revision=705872
5
--- a/server/mpm/worker/fdqueue.c (revision 705871)
6
+++ a/server/mpm/worker/fdqueue.c (revision 705872)
8
* region, one of two things may have happened:
9
* - If the idle worker count is still zero, the
10
* workers are all still busy, so it's safe to
11
- * block on a condition variable.
12
+ * block on a condition variable, BUT
13
+ * we need to check for idle worker count again
14
+ * when we are signaled since it can happen that
15
+ * we are signaled by a worker thread that went idle
16
+ * but received a context switch before it could
17
+ * tell us. If it does signal us later once it is on
18
+ * CPU again there might be no idle worker left.
20
+ * https://issues.apache.org/bugzilla/show_bug.cgi?id=45605#c4
21
* - If the idle worker count is nonzero, then a
22
* worker has become idle since the first check
23
* of queue_info->idlers above. It's possible
25
* now nonzero, it's safe for this function to
28
- if (queue_info->idlers == 0) {
29
+ while (queue_info->idlers == 0) {
30
rv = apr_thread_cond_wait(queue_info->wait_for_idler,
31
queue_info->idlers_mutex);
32
if (rv != APR_SUCCESS) {