mturk 2005/02/07 11:07:38
Modified: jk/native/apache-2.0 mod_jk.c
Log:
Use new shmem api that uses single instance shared memory.
Revision Changes Path
1.121 +23 -18 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
Index: mod_jk.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
retrieving revision 1.120
retrieving revision 1.121
diff -u -r1.120 -r1.121
--- mod_jk.c 6 Feb 2005 13:30:34 -0000 1.120
+++ mod_jk.c 7 Feb 2005 19:07:38 -0000 1.121
@@ -190,7 +190,6 @@
static jk_worker_env_t worker_env;
static apr_global_mutex_t *jk_log_lock = NULL;
static char *jk_shm_file = NULL;
-static jk_shm_t jk_shmem = { 0, NULL, -1, NULL, 0};
static int JK_METHOD ws_start_response(jk_ws_service_t *s,
int status,
@@ -1670,10 +1669,11 @@
*/
apr_status_t jk_cleanup_shmem(void *data)
{
- if (jk_shmem.base) {
- jk_shm_close(&jk_shmem);
- jk_shmem.base = NULL;
- }
+ jk_logger_t *l = data;
+ jk_shm_close();
+ if (l && JK_IS_DEBUG_LEVEL(l))
+ jk_log(l, JK_LOG_DEBUG, "Shmem cleanup");
+
return 0;
}
@@ -2248,14 +2248,16 @@
if (mpm_threads > 0)
jk_set_worker_def_cache_size(mpm_threads);
- rc = jk_shm_attach(jk_shm_file, 0, 0, &jk_shmem);
- if (JK_IS_DEBUG_LEVEL(conf->log))
- jk_log(conf->log, JK_LOG_DEBUG, "Attached shm:%s with status %d",
- jk_shmem.filename, rc);
- if (!rc) {
- apr_pool_cleanup_register(pconf, s, jk_cleanup_shmem,
+ if ((rc = jk_shm_attach(jk_shm_file)) == 0) {
+ if (JK_IS_DEBUG_LEVEL(conf->log))
+ jk_log(conf->log, JK_LOG_DEBUG, "Attached shm:%s",
+ jk_shm_name());
+ apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_shmem,
jk_cleanup_shmem);
}
+ else
+ jk_log(conf->log, JK_LOG_ERROR, "Attachning shm:%s errno=%d",
+ jk_shm_name(), rc);
if (JK_IS_DEBUG_LEVEL(conf->log))
jk_log(conf->log, JK_LOG_DEBUG, "Initialized %s",
JK_EXPOSED_VERSION);
@@ -2278,14 +2280,17 @@
/* jk_map_t *init_map = NULL; */
jk_map_t *init_map = conf->worker_properties;
- rc = jk_shm_open(jk_shm_file, 0, 0, &jk_shmem);
- if (JK_IS_DEBUG_LEVEL(conf->log))
- jk_log(conf->log, JK_LOG_DEBUG, "Initialized shm:%s with status %d",
- jk_shmem.filename, rc);
- if (!rc) {
- apr_pool_cleanup_register(pconf, s, jk_cleanup_shmem,
+ ;
+ if ((rc = jk_shm_open(jk_shm_file)) == 0) {
+ if (JK_IS_DEBUG_LEVEL(conf->log))
+ jk_log(conf->log, JK_LOG_DEBUG, "Initialized shm:%s",
+ jk_shm_name(), rc);
+ apr_pool_cleanup_register(pconf, conf->log, jk_cleanup_shmem,
jk_cleanup_shmem);
}
+ else
+ jk_log(conf->log, JK_LOG_ERROR, "Initializing shm:%s errno=%d",
+ jk_shm_name(), rc);
if (!uri_worker_map_alloc(&(conf->uw_map),
conf->uri_to_context,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]