From: Mladen Turk Date: Mon, 30 Mar 2009 07:54:05 +0000 (+0000) Subject: Run the callback from pool cleanup. X-Git-Tag: 2.3.3~752 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=571705e972bcd1f1179a886c6b7b472b49730f20;p=thirdparty%2Fapache%2Fhttpd.git Run the callback from pool cleanup. 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 --- diff --git a/modules/mappers/mod_watchdog.c b/modules/mappers/mod_watchdog.c index 17614dd9dcb..7fd3dfb61f9 100644 --- a/modules/mappers/mod_watchdog.c +++ b/modules/mappers/mod_watchdog.c @@ -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;