]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Run the callback from pool cleanup.
authorMladen Turk <mturk@apache.org>
Mon, 30 Mar 2009 07:54:05 +0000 (07:54 +0000)
committerMladen Turk <mturk@apache.org>
Mon, 30 Mar 2009 07:54:05 +0000 (07:54 +0000)
This allows to break the blocked callbacks

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@759860 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_watchdog.c

index 17614dd9dcbd1b082881656b7c4166955f99f98b..7fd3dfb61f94c359610cbd94d674e185368cf81d 100644 (file)
@@ -76,6 +76,19 @@ static apr_status_t wd_worker_cleanup(void *data)
 {
     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;