apr_sleep(AP_WD_TM_SLICE);
}
}
+
+ apr_pool_create(&temp_pool, w->pool);
+ apr_pool_tag(temp_pool, "wd_running");
+
if (w->is_running) {
watchdog_list_t *wl = w->callbacks;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, wd_server_conf->s,
w->singleton ? "Singleton " : "", w->name);
apr_time_clock_hires(w->pool);
if (wl) {
- apr_pool_create(&temp_pool, w->pool);
- apr_pool_tag(temp_pool, "wd_running-singleton");
while (wl && w->is_running) {
/* Execute watchdog callback */
wl->status = (*wl->callback_fn)(AP_WATCHDOG_STATE_STARTING,
(void *)wl->data, temp_pool);
wl = wl->next;
}
- apr_pool_destroy(temp_pool);
- temp_pool = NULL;
+ apr_pool_clear(temp_pool);
}
else {
ap_run_watchdog_init(wd_server_conf->s, w->name, w->pool);
if (wl->status == APR_SUCCESS) {
wl->step += (apr_time_now() - curr);
if (wl->step >= wl->interval) {
- if (!temp_pool) {
- apr_pool_create(&temp_pool, w->pool);
- apr_pool_tag(temp_pool, "wd_running-callback");
- }
wl->step = 0;
/* Execute watchdog callback */
wl->status = (*wl->callback_fn)(AP_WATCHDOG_STATE_RUNNING,
*/
w->step += (apr_time_now() - curr);
if (w->step >= wd_interval) {
- if (!temp_pool) {
- apr_pool_create(&temp_pool, w->pool);
- apr_pool_tag(temp_pool, "wd_running");
- }
w->step = 0;
/* Run watchdog step hook */
ap_run_watchdog_step(wd_server_conf->s, w->name, temp_pool);
}
}
- if (temp_pool) {
- apr_pool_destroy(temp_pool);
- temp_pool = NULL;
- }
- if (!w->is_running) {
- break;
- }
+
+ apr_pool_clear(temp_pool);
}
+
+ apr_pool_destroy(temp_pool);
+
if (inited) {
/* Run the watchdog exit hooks.
* If this was singleton watchdog the init hook