You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mt...@apache.org on 2009/03/30 09:54:06 UTC

svn commit: r759860 - /httpd/httpd/trunk/modules/mappers/mod_watchdog.c

Author: mturk
Date: Mon Mar 30 07:54:05 2009
New Revision: 759860

URL: http://svn.apache.org/viewvc?rev=759860&view=rev
Log:
Run the callback from pool cleanup.
This allows to break the blocked callbacks

Modified:
    httpd/httpd/trunk/modules/mappers/mod_watchdog.c

Modified: httpd/httpd/trunk/modules/mappers/mod_watchdog.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_watchdog.c?rev=759860&r1=759859&r2=759860&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_watchdog.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_watchdog.c Mon Mar 30 07:54:05 2009
@@ -76,6 +76,19 @@
 {
     apr_status_t rv;
     ap_watchdog_t *w = (ap_watchdog_t *)data;
+
+    if (w->is_running) {
+        watchdog_list_t *wl = w->callbacks;
+        while (wl) {
+            if (wl->status == APR_SUCCESS) {
+                /* Execute watchdog callback with STOPPING state */
+                (*wl->callback_fn)(AP_WATCHDOG_STATE_STOPPING,
+                                    (void *)wl->data, w->pool);
+                wl->status = APR_EOF;
+            }
+            wl = wl->next;
+        }
+    }
     w->is_running = 0;
     apr_thread_join(&rv, w->thread);
     return rv;