You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by rj...@apache.org on 2015/01/05 11:39:50 UTC

svn commit: r1649498 - /tomcat/jk/trunk/native/apache-2.0/mod_jk.c

Author: rjung
Date: Mon Jan  5 10:39:50 2015
New Revision: 1649498

URL: http://svn.apache.org/r1649498
Log:
Use separate cleanups for child and main
process.

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

Modified: tomcat/jk/trunk/native/apache-2.0/mod_jk.c
URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/apache-2.0/mod_jk.c?rev=1649498&r1=1649497&r2=1649498&view=diff
==============================================================================
--- tomcat/jk/trunk/native/apache-2.0/mod_jk.c (original)
+++ tomcat/jk/trunk/native/apache-2.0/mod_jk.c Mon Jan  5 10:39:50 2015
@@ -2638,9 +2638,17 @@ static const command_rec jk_cmds[] = {
 /* The JK module handlers                                                    */
 /* ========================================================================= */
 
-/** Util - cleanup shmem.
+/** Util - cleanup for all processes.
  */
-static apr_status_t jk_cleanup_shmem(void *data)
+static apr_status_t jk_cleanup_proc(void *data)
+{
+    jk_shm_close(main_log);
+    return APR_SUCCESS;
+}
+
+/** Util - cleanup for child processes.
+ */
+static apr_status_t jk_cleanup_child(void *data)
 {
     /* Force the watchdog thread exit */
     if (jk_watchdog_interval > 0) {
@@ -2648,8 +2656,7 @@ static apr_status_t jk_cleanup_shmem(voi
         while (jk_watchdog_running)
             apr_sleep(apr_time_from_sec(1));
     }
-    jk_shm_close(main_log);
-    return APR_SUCCESS;
+    return jk_cleanup_proc(data);
 }
 
 /** Main service method, called to forward a request to tomcat
@@ -3386,7 +3393,7 @@ static void jk_child_init(apr_pool_t * p
     }
 
     if ((rc = jk_shm_attach(jk_shm_file, jk_shm_size, conf->log)) == 0) {
-        apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_shmem,
+        apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_child,
                                   apr_pool_cleanup_null);
     }
     else {
@@ -3490,7 +3497,7 @@ static int init_jk(apr_pool_t * pconf, j
     }
     if ((rc = jk_shm_open(jk_shm_file, jk_shm_size, conf->log)) == 0) {
         apr_pool_cleanup_register(pconf, conf->log,
-                                  jk_cleanup_shmem,
+                                  jk_cleanup_proc,
                                   apr_pool_cleanup_null);
     }
     else {



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