cvs commit: jakarta-tomcat-connectors/jk/native/common jk_mt.h jk_util.c
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 ChangesPath 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 - 1.9 +++ jk_mt.h 30 Nov 2004 13:11:21 - 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 - 1.42 +++ jk_util.c 30 Nov 2004 13:11:21 - 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 0x); +} + +#endif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_mt.h jk_util.c
[EMAIL PROTECTED] wrote: mturk 2004/11/11 23:46:49 Modified:jk/native/common jk_mt.h jk_util.c Log: Fix Netware getpid/gettid. Revision ChangesPath 1.8 +10 -6 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.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jk_mt.h 11 Nov 2004 17:04:04 - 1.7 +++ jk_mt.h 12 Nov 2004 07:46:48 - 1.8 @@ -25,6 +25,13 @@ #include jk_global.h + +#if defined(WIN32) +#define jk_gettid()((int)GetCurrentThreadId()) +#elif defined(NETWARE) +#define jk_gettid()((int)GetThreadID()) +#endif + /* * All WIN32 code is MT, UNIX code that uses pthreads is marked by the POSIX * _REENTRANT define. @@ -47,8 +54,6 @@ #define JK_ENTER_CS(x, rc) EnterCriticalSection(x); rc = JK_TRUE; #define JK_LEAVE_CS(x, rc) LeaveCriticalSection(x); rc = JK_TRUE; -#define JK_THREADID() ((int)GetCurrentThreadId()) - #else /* Unix pthreads */ #include pthread.h @@ -67,8 +72,7 @@ #define JK_LEAVE_CS(x, rc)\ if(pthread_mutex_unlock(x)) rc = JK_FALSE; else rc = JK_TRUE; -#define JK_THREADID() ((int)pthread_self()) - +#define jk_gettid() ((int)pthread_self()) #endif /* Unix pthreads */ #else /* Not an MT code */ @@ -79,7 +83,7 @@ #define JK_DELETE_CS(x, rc) rc = JK_TRUE; #define JK_ENTER_CS(x, rc) rc = JK_TRUE; #define JK_LEAVE_CS(x, rc) rc = JK_TRUE; -#define JK_THREADID() 0 +#define jk_gettid() 0 #endif /* Not an MT code */ 1.36 +3 -3 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.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- jk_util.c 11 Nov 2004 17:06:06 - 1.35 +++ jk_util.c 12 Nov 2004 07:46:48 - 1.36 @@ -272,11 +272,11 @@ #ifdef USE_SPRINTF /* until we get a snprintf function */ if (line) used += sprintf(buf[used], [%d:%d] , getpid(), -JK_THREADID()); +jk_gettid()); #else if (line) used += snprintf(buf[used], HUGE_BUFFER_SIZE, [%d:%d] , - getpid(), JK_THREADID()); + getpid(), jk_gettid()); #endif if (used 0) { return 0; /* [V] not sure what to return... */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . Greetings, Sad to say, the latest CVS jk_util.c still contains, at lines 275 and 279, two references to 'getpid', one of which (not sure which) is still causing CW to abort when building for Apache 1.3. Apache-2.x mod_jk(s) build without issue because the build scripts include hooks into the Apache 2.x source and pick up the 'getpid' definition from there. The os.h (for Apache 1.3) has a definition for 'getpid' as follows: #define getpid() ((pid_t)GetThreadGroupID()) Unfortunately the GetThreadGroupID() isn't part of LibC. So, another patch is attached, which adapts jk_mt.h for NetWare, and have been able to successfully build for Apache 2.0, 2.1 and Apache 1.3 using this. If this is the best solution for you or NetWare I am unable to say. Regards, Norm --- jk_mt.h.orig2004-11-12 20:10:05.0 +1100 +++ jk_mt.h 2004-11-12 21:11:17.0 +1100 @@ -29,6 +29,9 @@ #if defined(WIN32) #define jk_gettid()((int)GetCurrentThreadId()) #elif defined(NETWARE) +#if !defined(__NOVELL_LIBC__) +#define getpid() ((pid_t)GetThreadGroupID()) +#endif #define jk_gettid()((int)GetThreadID()) #endif --- jk_mt.h.orig2004-11-12 20:10:05.0 +1100 +++ jk_mt.h 2004-11-12 21:11:17.0 +1100 @@ -29,6 +29,9 @@ #if defined(WIN32) #define jk_gettid()((int)GetCurrentThreadId()) #elif defined(NETWARE) +#if !defined(__NOVELL_LIBC__) +#define getpid() ((pid_t)GetThreadGroupID()) +#endif #define jk_gettid()((int)GetThreadID()) #endif - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_mt.h jk_util.c
NormW wrote: +#if !defined(__NOVELL_LIBC__) +#define getpid() ((pid_t)GetThreadGroupID()) +#endif Committed, thanks! Can you confirm that we can compile on Netware now? Regards, Mladen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_mt.h jk_util.c
Mladen Turk wrote: NormW wrote: +#if !defined(__NOVELL_LIBC__) +#define getpid() ((pid_t)GetThreadGroupID()) +#endif Committed, thanks! Can you confirm that we can compile on Netware now? Regards, Mladen. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . Good morning, Pleased to advise that all builds fine for NetWare with AP1.3,3.0 and 2.1. Any progress on some docs? Would like to start some testing in earnest. Regards, Norm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_mt.h jk_util.c
mturk 2004/11/11 23:46:49 Modified:jk/native/common jk_mt.h jk_util.c Log: Fix Netware getpid/gettid. Revision ChangesPath 1.8 +10 -6 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.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- jk_mt.h 11 Nov 2004 17:04:04 - 1.7 +++ jk_mt.h 12 Nov 2004 07:46:48 - 1.8 @@ -25,6 +25,13 @@ #include jk_global.h + +#if defined(WIN32) +#define jk_gettid()((int)GetCurrentThreadId()) +#elif defined(NETWARE) +#define jk_gettid()((int)GetThreadID()) +#endif + /* * All WIN32 code is MT, UNIX code that uses pthreads is marked by the POSIX * _REENTRANT define. @@ -47,8 +54,6 @@ #define JK_ENTER_CS(x, rc) EnterCriticalSection(x); rc = JK_TRUE; #define JK_LEAVE_CS(x, rc) LeaveCriticalSection(x); rc = JK_TRUE; -#define JK_THREADID() ((int)GetCurrentThreadId()) - #else /* Unix pthreads */ #include pthread.h @@ -67,8 +72,7 @@ #define JK_LEAVE_CS(x, rc)\ if(pthread_mutex_unlock(x)) rc = JK_FALSE; else rc = JK_TRUE; -#define JK_THREADID() ((int)pthread_self()) - +#define jk_gettid() ((int)pthread_self()) #endif /* Unix pthreads */ #else /* Not an MT code */ @@ -79,7 +83,7 @@ #define JK_DELETE_CS(x, rc) rc = JK_TRUE; #define JK_ENTER_CS(x, rc) rc = JK_TRUE; #define JK_LEAVE_CS(x, rc) rc = JK_TRUE; -#define JK_THREADID() 0 +#define jk_gettid() 0 #endif /* Not an MT code */ 1.36 +3 -3 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.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- jk_util.c 11 Nov 2004 17:06:06 - 1.35 +++ jk_util.c 12 Nov 2004 07:46:48 - 1.36 @@ -272,11 +272,11 @@ #ifdef USE_SPRINTF /* until we get a snprintf function */ if (line) used += sprintf(buf[used], [%d:%d] , getpid(), -JK_THREADID()); +jk_gettid()); #else if (line) used += snprintf(buf[used], HUGE_BUFFER_SIZE, [%d:%d] , - getpid(), JK_THREADID()); + getpid(), jk_gettid()); #endif if (used 0) { return 0; /* [V] not sure what to return... */ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]