tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_mt.h jk_util.c
Date Fri, 12 Nov 2004 07:46:49 GMT
mturk       2004/11/11 23:46:49

  Modified:    jk/native/common jk_mt.h jk_util.c
  Log:
  Fix Netware getpid/gettid.
  
  Revision  Changes    Path
  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 -0000	1.7
  +++ jk_mt.h	12 Nov 2004 07:46:48 -0000	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 -0000	1.35
  +++ jk_util.c	12 Nov 2004 07:46:48 -0000	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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message