You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by yl...@apache.org on 2014/12/02 14:41:14 UTC

svn commit: r1642868 - /httpd/httpd/trunk/server/mpm/event/event.c

Author: ylavic
Date: Tue Dec  2 13:41:14 2014
New Revision: 1642868

URL: http://svn.apache.org/r1642868
Log:
mpm_event: follow up to r1639614.

Notify suspend in any case when starting lingering close (blocking),
and outside the lingering queue's critical section.

Modified:
    httpd/httpd/trunk/server/mpm/event/event.c

Modified: httpd/httpd/trunk/server/mpm/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1642868&r1=1642867&r2=1642868&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/event/event.c Tue Dec  2 13:41:14 2014
@@ -859,16 +859,16 @@ static int start_lingering_close_common(
         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)) {
@@ -895,6 +895,8 @@ static int start_lingering_close_common(
 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;
     }