diff options
author | Yann Ylavic <ylavic@apache.org> | 2024-04-12 12:35:10 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2024-04-12 12:35:10 +0200 |
commit | f9f742e7ba347ba207aaf23c4676e833a5cc8f1f (patch) | |
tree | 36b7aff86e2b14804c0a0c20a05bb644032bd88f /server | |
parent | mod_ssl_ct: Fix format warnings. (diff) | |
download | apache2-f9f742e7ba347ba207aaf23c4676e833a5cc8f1f.tar.xz apache2-f9f742e7ba347ba207aaf23c4676e833a5cc8f1f.zip |
mpm_event: Simplify pollset "good methods" vs APR_POLLSET_WAKEABLE.
* server/mpm/event/event.c(setup_threads_runtime):
Simplify pollset creation code.
All pollset "good methods" implement APR_POLLSET_WAKEABLE and wake-ability
is quite important for MPM event's correctness anyway so simplify code around
pollset creation so as not to suggest that APR_POLLSET_NODEFAULT if favored
against APR_POLLSET_WAKEABLE.
While at it account for the wakeup pipe in the pollset_size since not all
pollset methods seem to do it internally in APR.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1916925 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/mpm/event/event.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 3841142c60..372b94f61b 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -2630,9 +2630,9 @@ static void setup_threads_runtime(void) /* Create the main pollset */ 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; @@ -2640,19 +2640,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) |