tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r695860 - /tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
Date Tue, 16 Sep 2008 13:03:25 GMT
Author: mturk
Date: Tue Sep 16 06:03:24 2008
New Revision: 695860

URL: http://svn.apache.org/viewvc?rev=695860&view=rev
Log:
Use one second step for watchdog. This allows to break from the loop more promptly

Modified:
    tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c

Modified: tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c?rev=695860&r1=695859&r2=695860&view=diff
==============================================================================
--- tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c Tue Sep 16 06:03:24 2008
@@ -2191,7 +2191,10 @@
 static apr_status_t jk_cleanup_shmem(void *data)
 {
     /* Force the watchdog thread exit */
-    jk_watchdog_interval = 0;
+    if (jk_watchdog_interval > 0) {
+        jk_watchdog_interval = 0;
+        apr_sleep(apr_time_from_sec(2));
+    }
     jk_shm_close();
     return APR_SUCCESS;
 }
@@ -2791,18 +2794,23 @@
 
 static void * APR_THREAD_FUNC jk_watchdog_func(apr_thread_t *thd, void *data)
 {
+    int i;
     jk_server_conf_t *conf = (jk_server_conf_t *)data;
 
     if (JK_IS_DEBUG_LEVEL(conf->log))
         jk_log(conf->log, JK_LOG_DEBUG,
                "Watchdog initialized");
     for (;;) {
-        apr_sleep(apr_time_from_sec(jk_watchdog_interval));
+        for (i = 0; i < jk_watchdog_interval; i++) {
+            apr_sleep(apr_time_from_sec(1));
+            if (!jk_watchdog_interval)
+                break;
+        }
+        if (!jk_watchdog_interval)
+            break;
         if (JK_IS_DEBUG_LEVEL(conf->log))
            jk_log(conf->log, JK_LOG_DEBUG,
                   "Watchdog running");
-        if (!jk_watchdog_interval)
-            break;
         wc_maintain(conf->log);
     }
     return NULL;



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message