summaryrefslogtreecommitdiffstats
path: root/server/mpm/event/event.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/mpm/event/event.c')
-rw-r--r--server/mpm/event/event.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c
index 3672f44..7e7a7e9 100644
--- a/server/mpm/event/event.c
+++ b/server/mpm/event/event.c
@@ -2319,11 +2319,14 @@ static void setup_threads_runtime(void)
clean_child_exit(APEXIT_CHILDFATAL);
}
- /* Create the main pollset */
+ /* Create the main pollset. When APR_POLLSET_WAKEABLE is asked we account
+ * for the wakeup pipe explicitely with pollset_size+1 because some pollset
+ * implementations don't do it implicitely in APR.
+ */
pollset_flags = APR_POLLSET_THREADSAFE | APR_POLLSET_NOCOPY |
- APR_POLLSET_NODEFAULT | APR_POLLSET_WAKEABLE;
+ APR_POLLSET_WAKEABLE | APR_POLLSET_NODEFAULT;
for (i = 0; i < sizeof(good_methods) / sizeof(good_methods[0]); i++) {
- rv = apr_pollset_create_ex(&event_pollset, pollset_size, pruntime,
+ rv = apr_pollset_create_ex(&event_pollset, pollset_size + 1, pruntime,
pollset_flags, good_methods[i]);
if (rv == APR_SUCCESS) {
listener_is_wakeable = 1;
@@ -2331,19 +2334,17 @@ static void setup_threads_runtime(void)
}
}
if (rv != APR_SUCCESS) {
- pollset_flags &= ~APR_POLLSET_WAKEABLE;
- for (i = 0; i < sizeof(good_methods) / sizeof(good_methods[0]); i++) {
- rv = apr_pollset_create_ex(&event_pollset, pollset_size, pruntime,
- pollset_flags, good_methods[i]);
- if (rv == APR_SUCCESS) {
- break;
- }
- }
- }
- if (rv != APR_SUCCESS) {
pollset_flags &= ~APR_POLLSET_NODEFAULT;
- rv = apr_pollset_create(&event_pollset, pollset_size, pruntime,
+ rv = apr_pollset_create(&event_pollset, pollset_size + 1, pruntime,
pollset_flags);
+ if (rv == APR_SUCCESS) {
+ listener_is_wakeable = 1;
+ }
+ else {
+ pollset_flags &= ~APR_POLLSET_WAKEABLE;
+ rv = apr_pollset_create(&event_pollset, pollset_size, pruntime,
+ pollset_flags);
+ }
}
if (rv != APR_SUCCESS) {
ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, APLOGNO(03103)