From: Jim Jagielski Date: Tue, 16 Dec 2014 13:06:48 +0000 (+0000) Subject: Merge r1642868 from trunk: X-Git-Tag: 2.4.11~84 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd9b5bf07c68340e0352bd3d7a61b3bb2417c407;p=apache Merge r1642868 from trunk: mpm_event: follow up to r1639614 (trunk) and r1642858 (2.4.x). Notify suspend in any case when starting lingering close (blocking), and outside the lingering queue's critical section. Submitted by: ylavic Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1645936 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index d10f0e9dbf..bad336627e 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -810,16 +810,16 @@ static int start_lingering_close_common(event_conn_state_t *cs, int in_worker) cs->pub.state = CONN_STATE_LINGER_NORMAL; } apr_atomic_inc32(&lingering_count); - apr_thread_mutex_lock(timeout_mutex); cs->c->sbh = NULL; + if (in_worker) { + notify_suspend(cs); + } + apr_thread_mutex_lock(timeout_mutex); TO_QUEUE_APPEND(*q, cs); cs->pfd.reqevents = ( cs->pub.sense == CONN_SENSE_WANT_WRITE ? APR_POLLOUT : APR_POLLIN) | APR_POLLHUP | APR_POLLERR; cs->pub.sense = CONN_SENSE_DEFAULT; - if (in_worker) { - notify_suspend(cs); - } rv = apr_pollset_add(event_pollset, &cs->pfd); apr_thread_mutex_unlock(timeout_mutex); if (rv != APR_SUCCESS && !APR_STATUS_IS_EEXIST(rv)) { @@ -846,6 +846,8 @@ static int start_lingering_close_common(event_conn_state_t *cs, int in_worker) static int start_lingering_close_blocking(event_conn_state_t *cs) { if (ap_start_lingering_close(cs->c)) { + cs->c->sbh = NULL; + notify_suspend(cs); ap_push_pool(worker_queue_info, cs->p); return 0; }