You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/05/31 19:49:07 UTC
cvs commit: jakarta-tomcat-connectors/jk/native2/include jk_config.h jk_env.h jk_mutex.h jk_objCache.h jk_worker.h jk_workerEnv.h
costin 2002/05/31 10:49:07
Modified: jk/native2/include jk_config.h jk_env.h jk_mutex.h
jk_objCache.h jk_worker.h jk_workerEnv.h
Log:
Use jk_mutex for sync.
Changed jk_mutex to preserve backward compatiblity and support where APR
is not available.
Revision Changes Path
1.8 +13 -2 jakarta-tomcat-connectors/jk/native2/include/jk_config.h
Index: jk_config.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_config.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- jk_config.h 29 May 2002 00:10:18 -0000 1.7
+++ jk_config.h 31 May 2002 17:49:07 -0000 1.8
@@ -63,7 +63,6 @@
#define JK_CONFIG_H
#include "jk_global.h"
-#include "jk_mt.h"
#include "jk_pool.h"
#include "jk_env.h"
#include "jk_logger.h"
@@ -126,14 +125,26 @@
struct jk_map *cfgData;
/* Only one thread can update the config
*/
- JK_CRIT_SEC cs;
+ struct jk_mutex *cs;
time_t mtime;
};
+int jk2_config_setProperty(struct jk_env *env, struct jk_config *cfg,
+ struct jk_bean *mbean, char *name, char *val);
+
+int jk2_config_setPropertyString(struct jk_env *env, struct jk_config *cfg,
+ char *name, char *value);
+
+int jk2_config_processConfigData(struct jk_env *env, struct jk_config *cfg,
+ int firstTime );
+
+
char *jk2_config_replaceProperties(struct jk_env *env, struct jk_map *m,
struct jk_pool *resultPool,
char *value);
+int jk2_config_processNode(struct jk_env *env, struct jk_config *cfg,
+ char *name, int firstTime );
#ifdef __cplusplus
}
1.19 +1 -0 jakarta-tomcat-connectors/jk/native2/include/jk_env.h
Index: jk_env.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_env.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- jk_env.h 29 May 2002 17:51:23 -0000 1.18
+++ jk_env.h 31 May 2002 17:49:07 -0000 1.19
@@ -68,6 +68,7 @@
#include "jk_map.h"
#include "jk_worker.h"
#include "jk_bean.h"
+#include "jk_mutex.h"
#define JK_LINE __FILE__,__LINE__
1.2 +26 -0 jakarta-tomcat-connectors/jk/native2/include/jk_mutex.h
Index: jk_mutex.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_mutex.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jk_mutex.h 24 May 2002 04:24:50 -0000 1.1
+++ jk_mutex.h 31 May 2002 17:49:07 -0000 1.2
@@ -71,9 +71,21 @@
struct jk_env;
struct jk_mutex;
+
+#ifdef HAS_APR
+#include "apr_thread_mutex.h"
+#elif defined( WIN32 )
+#include <windows.h>
+#elif defined( _REENTRANT )
+#include <pthread.h>
+#endif
+
typedef struct jk_mutex jk_mutex_t;
+#define MUTEX_LOCK 4
+#define MUTEX_TRYLOCK 5
+#define MUTEX_UNLOCK 6
/**
* Interprocess mutex support. This is a wrapper to APR.
@@ -105,7 +117,21 @@
/* Private data */
void *privateData;
+
+#ifdef HAS_APR
+ apr_thread_mutex_t *threadMutex;
+#elif defined( WIN32 )
+ CRITICAL_SECTION threadMutex;
+#elif defined( _REENTRANT )
+ pthread_mutex_t threadMutex;
+#else
+ void *threadMutex;
+#endif
};
+
+int JK_METHOD jk2_mutex_invoke(struct jk_env *env, struct jk_bean *bean, struct jk_endpoint *ep, int code,
+ struct jk_msg *msg, int raw);
+
#ifdef __cplusplus
}
1.7 +1 -2 jakarta-tomcat-connectors/jk/native2/include/jk_objCache.h
Index: jk_objCache.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_objCache.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- jk_objCache.h 21 Feb 2002 11:15:51 -0000 1.6
+++ jk_objCache.h 31 May 2002 17:49:07 -0000 1.7
@@ -63,7 +63,6 @@
#include "jk_logger.h"
#include "jk_pool.h"
#include "jk_msg.h"
-#include "jk_mt.h"
#ifdef __cplusplus
extern "C" {
@@ -118,7 +117,7 @@
/* Sync.
*/
- JK_CRIT_SEC cs;
+ struct jk_mutex *cs;
/** Objects in the cache */
void **data;
1.24 +2 -3 jakarta-tomcat-connectors/jk/native2/include/jk_worker.h
Index: jk_worker.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_worker.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- jk_worker.h 16 May 2002 20:49:53 -0000 1.23
+++ jk_worker.h 31 May 2002 17:49:07 -0000 1.24
@@ -58,7 +58,7 @@
/***************************************************************************
* Description: Workers controller header file *
* Author: Gal Shachor <sh...@il.ibm.com> *
- * Version: $Revision: 1.23 $ *
+ * Version: $Revision: 1.24 $ *
***************************************************************************/
#ifndef JK_WORKER_H
@@ -70,7 +70,6 @@
#include "jk_service.h"
#include "jk_endpoint.h"
#include "jk_map.h"
-#include "jk_mt.h"
#include "jk_uriMap.h"
#include "jk_objCache.h"
#include "jk_msg.h"
@@ -170,7 +169,7 @@
/* Private key used to connect to the remote side2.*/
char * secret;
- JK_CRIT_SEC cs;
+ struct jk_mutex *cs;
/* -------------------- Information used for load balancing ajp workers -------------------- */
/** The id of the tomcat instance we connect to. We may have multiple
1.26 +2 -2 jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h
Index: jk_workerEnv.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/include/jk_workerEnv.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- jk_workerEnv.h 29 May 2002 00:10:18 -0000 1.25
+++ jk_workerEnv.h 31 May 2002 17:49:07 -0000 1.26
@@ -58,7 +58,7 @@
/***************************************************************************
* Description: Workers controller header file *
* Author: Gal Shachor <sh...@il.ibm.com> *
- * Version: $Revision: 1.25 $ *
+ * Version: $Revision: 1.26 $ *
***************************************************************************/
#ifndef JK_WORKERENV_H
@@ -246,7 +246,7 @@
*/
void *_private;
- JK_CRIT_SEC cs;
+ struct jk_mutex *cs;
/* Global setting to enable counters on all requests.
* That adds about 2-3 ms per request ( at least on linux ),
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>