httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r575282 - in /httpd/httpd/branches/2.2.x: STATUS server/mpm/experimental/event/event.c
Date Thu, 13 Sep 2007 12:20:07 GMT
Author: jim
Date: Thu Sep 13 05:20:04 2007
New Revision: 575282

URL: http://svn.apache.org/viewvc?rev=575282&view=rev
Log:
    * Event MPM: Rework locking of the timeout_mutex, to never hold it while
          calling blocking operations on the worker queue.
                Trunk version of patch: 
                        http://svn.apache.org/viewvc?view=rev&revision=567852
                                http://svn.apache.org/viewvc?view=rev&revision=574462
                                      2.2.x version of patch:
                                              http://people.apache.org/~pquerna/event-mpm-deadlock.patch
   +1: pquerna, jim, rpluem


Modified:
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=575282&r1=575281&r2=575282&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Thu Sep 13 05:20:04 2007
@@ -79,14 +79,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-    * Event MPM: Rework locking of the timeout_mutex, to never hold it while
-      calling blocking operations on the worker queue.
-      Trunk version of patch:
-        http://svn.apache.org/viewvc?view=rev&revision=567852
-        http://svn.apache.org/viewvc?view=rev&revision=574462
-      2.2.x version of patch:
-        http://people.apache.org/~pquerna/event-mpm-deadlock.patch
-    +1: pquerna, jim, rpluem
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
 

Modified: httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c?rev=575282&r1=575281&r2=575282&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c (original)
+++ httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c Thu Sep 13 05:20:04 2007
@@ -1020,12 +1020,19 @@
         cs = APR_RING_FIRST(&timeout_head);
         timeout_time = time_now + TIMEOUT_FUDGE_FACTOR;
         while (!APR_RING_EMPTY(&timeout_head, conn_state_t, timeout_list)
-               && cs->expiration_time < timeout_time
-               && get_worker(&have_idle_worker)) {
+               && cs->expiration_time < timeout_time) {
 
             cs->state = CONN_STATE_LINGER;
 
             APR_RING_REMOVE(cs, timeout_list);
+            apr_thread_mutex_unlock(timeout_mutex);
+
+            if (!get_worker(&have_idle_worker)) {
+                apr_thread_mutex_lock(timeout_mutex);
+                APR_RING_INSERT_HEAD(&timeout_head, cs,
+                                     conn_state_t, timeout_list);
+                break;
+            }
 
             rc = push2worker(&cs->pfd, event_pollset);
 
@@ -1038,6 +1045,7 @@
                  */
             }
             have_idle_worker = 0;
+            apr_thread_mutex_lock(timeout_mutex);
             cs = APR_RING_FIRST(&timeout_head);
         }
         apr_thread_mutex_unlock(timeout_mutex);



Mime
View raw message