From e3844f26d0674149cf0d0ab708a42edc75748d42 Mon Sep 17 00:00:00 2001 From: Paul Querna Date: Tue, 15 Nov 2011 15:52:59 +0000 Subject: [PATCH] Use apr_pollset_wakeup to ensure that the listener thread will process most enqueue'd events quickly git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1202259 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/event/event.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index c20f387ec3..7c532b394b 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -836,6 +836,7 @@ static int start_lingering_close(conn_state_t *cs, ap_equeue_t *eq) v->cs = cs; if (eq != NULL) { ap_equeue_writer_onward(eq); + apr_pollset_wakeup(event_pollset); } else { process_pollop(v); @@ -994,6 +995,7 @@ read_request: v->tag = "process_socket(write_completion)"; ap_equeue_writer_onward(eq); + apr_pollset_wakeup(event_pollset); return 1; } else if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted || @@ -1035,6 +1037,7 @@ read_request: cs->pfd.reqevents = APR_POLLIN; v->tag = "process_socket(keepalive)"; ap_equeue_writer_onward(eq); + apr_pollset_wakeup(event_pollset); } return 1; } @@ -1944,7 +1947,7 @@ static void *APR_THREAD_FUNC start_threads(apr_thread_t * thd, void *dummy) * connections in K-A or lingering * close? */ - pchild, APR_POLLSET_NOCOPY); + pchild, APR_POLLSET_WAKEABLE|APR_POLLSET_NOCOPY); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, "apr_pollset_create with Thread Safety failed."); @@ -2860,7 +2863,7 @@ static int event_pre_config(apr_pool_t * pconf, apr_pool_t * plog, ++retained->module_loads; if (retained->module_loads == 2) { rv = apr_pollset_create(&event_pollset, 1, plog, - APR_POLLSET_NOCOPY); + APR_POLLSET_WAKEABLE|APR_POLLSET_NOCOPY); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_CRIT, rv, NULL, "Couldn't create a suiteable pollset. " -- 2.40.0