mturk 2004/11/30 05:11:21
Modified: jk/native/common jk_mt.h jk_util.c
Log:
Use a lower word of pthread_t as a thread identifier.
Revision Changes Path
1.10 +3 -2 jakarta-tomcat-connectors/jk/native/common/jk_mt.h
Index: jk_mt.h
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_mt.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- jk_mt.h 12 Nov 2004 10:56:03 -0000 1.9
+++ jk_mt.h 30 Nov 2004 13:11:21 -0000 1.10
@@ -60,6 +60,7 @@
#else /* Unix pthreads */
+#define _MT_CODE_PTHREAD
#include <pthread.h>
typedef pthread_mutex_t JK_CRIT_SEC;
@@ -76,7 +77,7 @@
#define JK_LEAVE_CS(x, rc)\
if(pthread_mutex_unlock(x)) rc = JK_FALSE; else rc = JK_TRUE;
-#define jk_gettid() ((int)pthread_self())
+int jk_gettid();
#endif /* Unix pthreads */
#else /* Not an MT code */
1.43 +12 -1 jakarta-tomcat-connectors/jk/native/common/jk_util.c
Index: jk_util.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_util.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- jk_util.c 29 Nov 2004 16:22:08 -0000 1.42
+++ jk_util.c 30 Nov 2004 13:11:21 -0000 1.43
@@ -1014,3 +1014,14 @@
s->jvm_route = NULL;
s->retries = JK_RETRIES;
}
+
+#ifdef _MT_CODE_PTHREAD
+
+int jk_gettid()
+{
+ pthread_t t = pthread_self();
+
+ return (int)(t & 0xFFFF);
+}
+
+#endif
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]