httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r630335 - in /httpd/httpd/trunk: CHANGES server/mpm/worker/fdqueue.c
Date Fri, 22 Feb 2008 22:17:44 GMT
Author: niq
Date: Fri Feb 22 14:17:42 2008
New Revision: 630335

URL: http://svn.apache.org/viewvc?rev=630335&view=rev
Log:
Worker MPM: fix race condition
PR44402: reported and fixed by Basant Kumar Kukreja

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/server/mpm/worker/fdqueue.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=630335&r1=630334&r2=630335&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Fri Feb 22 14:17:42 2008
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) Worker MPM: fix race condition in recycling a pool
+     PR 44402 [Basant Kumar Kukreja <basant.kukreja sun.com>]
+
   *) mod_include: Correctly handle SSI directives split over multiple filter
      passes.  PR 44447 [Harald Niesche <harald brokenerror.de>]
 

Modified: httpd/httpd/trunk/server/mpm/worker/fdqueue.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/fdqueue.c?rev=630335&r1=630334&r2=630335&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/fdqueue.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/fdqueue.c Fri Feb 22 14:17:42 2008
@@ -94,10 +94,14 @@
                                                          sizeof(*new_recycle));
         new_recycle->pool = pool_to_recycle;
         for (;;) {
-            new_recycle->next = queue_info->recycled_pools;
+            /* Save queue_info->recycled_pool in local variable next because
+             * new_recycle->next can be changed after apr_atomic_casptr
+             * function call.
+             */
+            struct recycled_pool *next = queue_info->recycled_pools;
+            new_recycle->next = next;
             if (apr_atomic_casptr((volatile void**)&(queue_info->recycled_pools),
-                                  new_recycle, new_recycle->next) ==
-                new_recycle->next) {
+                                  new_recycle, new_recycle->next) == next) {
                 break;
             }
         }



Mime
View raw message