httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r736809 - /httpd/httpd/trunk/modules/cluster/mod_heartbeat.c
Date Thu, 22 Jan 2009 21:47:16 GMT
Author: pquerna
Date: Thu Jan 22 13:47:16 2009
New Revision: 736809

URL: http://svn.apache.org/viewvc?rev=736809&view=rev
Log:
Use the more traditional create/clear/destroy style for the main loop pool.
Suggested by: jerenkrantz

Modified:
    httpd/httpd/trunk/modules/cluster/mod_heartbeat.c

Modified: httpd/httpd/trunk/modules/cluster/mod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartbeat.c?rev=736809&r1=736808&r2=736809&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartbeat.c Thu Jan 22 13:47:16 2009
@@ -120,6 +120,7 @@
 
 static void* APR_THREAD_FUNC hb_worker(apr_thread_t *thd, void *data)
 {
+    apr_pool_t *tpool;
     hb_ctx_t *ctx = (hb_ctx_t *) data;
     apr_status_t rv;
 
@@ -137,9 +138,10 @@
         apr_sleep(apr_time_from_msec(200));
     }
 
+    apr_pool_create(&tpool, pool);
     while (ctx->keep_running) {
+        apr_pool_clear(tpool);
         int mpm_state = 0;
-        apr_pool_t *tpool;
 
         rv = ap_mpm_query(AP_MPMQ_MPM_STATE, &mpm_state);
 
@@ -152,13 +154,12 @@
             break;
         }
 
-        apr_pool_create(&tpool, pool);
         apr_pool_tag(tpool, "heartbeat_worker_temp");
         hb_monitor(ctx, tpool);
-        apr_pool_destroy(tpool);
         apr_sleep(apr_time_from_sec(HEARTBEAT_INTERVAL));
     }
 
+    apr_pool_destroy(tpool);
     apr_proc_mutex_unlock(ctx->mutex);
     apr_thread_exit(ctx->thread, APR_SUCCESS);
 



Mime
View raw message