Hi Rainer,

patch works ;)

Thanks
Peter


Am 31.05.2007 um 19:09 schrieb Rainer Jung:

Could you try to find out, how pthread_t is defined on OS X?
Does the following patch help?

Index: jk_util.c
===================================================================
--- jk_util.c   (revision 542900)
+++ jk_util.c   (working copy)
@@ -1686,12 +1686,87 @@
     pthread_getunique_np(&t, &tid);
     return ((int)(tid.intId.lo & 0xFFFFFFFF));
 #else
-    int tid = (int)(t & 0xFFFF);
+    int tid = ((int)t) & 0xFFFF;
     return tid;
 #endif /* AS400 */
 }
 #endif


Regards,

Rainer

Peter Rossbach wrote:
Hi Rainer,
your _REENTRANT fix trigger a next MAC OS X problem:
eragon:~/workshop/tomcat-connectors-1.2.23-src/native peter$ make
Making all in common
/opt/local/share/apr-1/build/libtool --silent --mode=compile gcc - I/Users/peter/workshop/apache2/include -Wall -g -O2 -DHAVE_APR -I/ opt/local/include/apr-1 -I/opt/local/include/apr-1 -Wall -DDARWIN - DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I /Library/Java/ Home/include -I /Library/Java/Home/include/ -c jk_ajp12_worker.c - o jk_ajp12_worker.lo /opt/local/share/apr-1/build/libtool --silent --mode=compile gcc - I/Users/peter/workshop/apache2/include -Wall -g -O2 -DHAVE_APR -I/ opt/local/include/apr-1 -I/opt/local/include/apr-1 -Wall -DDARWIN - DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I /Library/Java/ Home/include -I /Library/Java/Home/include/ -c jk_connect.c -o jk_connect.lo /opt/local/share/apr-1/build/libtool --silent --mode=compile gcc - I/Users/peter/workshop/apache2/include -Wall -g -O2 -DHAVE_APR -I/ opt/local/include/apr-1 -I/opt/local/include/apr-1 -Wall -DDARWIN - DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I /Library/Java/ Home/include -I /Library/Java/Home/include/ -c jk_msg_buff.c -o jk_msg_buff.lo /opt/local/share/apr-1/build/libtool --silent --mode=compile gcc - I/Users/peter/workshop/apache2/include -Wall -g -O2 -DHAVE_APR -I/ opt/local/include/apr-1 -I/opt/local/include/apr-1 -Wall -DDARWIN - DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I /Library/Java/ Home/include -I /Library/Java/Home/include/ -c jk_util.c -o jk_util.lo
jk_util.c: In function 'jk_gettid':
jk_util.c:1723: error: invalid operands to binary &
make[1]: *** [jk_util.lo] Error 1
make: *** [all-recursive] Error 1
testet with apache 2.2.4.
Regards
peter
Am 31.05.2007 um 11:28 schrieb [EMAIL PROTECTED]:
Author: rjung
Date: Thu May 31 02:27:59 2007
New Revision: 543093

URL: http://svn.apache.org/viewvc?view=rev&rev=543093
Log:
Always build thread safe against Apache httpd 2.0/2.2
(unless configure detects --enable-prefork).
_REENTRANT flag for APR is not a safe threading detection
for all platforms.

Modified:
    tomcat/connectors/trunk/jk/native/common/jk_mt.h
    tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml
    tomcat/connectors/trunk/jk/xdocs/webserver_howto/apache.xml

Modified: tomcat/connectors/trunk/jk/native/common/jk_mt.h
URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/ native/common/jk_mt.h?view=diff&rev=543093&r1=543092&r2=543093 ==================================================================== ==========
--- tomcat/connectors/trunk/jk/native/common/jk_mt.h (original)
+++ tomcat/connectors/trunk/jk/native/common/jk_mt.h Thu May 31 02:27:59 2007
@@ -33,18 +33,10 @@
 #define getpid()       ((int)GetThreadGroupID())
 #endif

-/*
- * All WIN32 code is MT, UNIX code that uses pthreads is marked by the POSIX
- * _REENTRANT define.
- */
-#if defined (WIN32) || defined(_REENTRANT) || (defined(NETWARE) && defined(__NOVELL_LIBC__))
 #ifdef JK_PREFORK
 #define _MT_CODE 0
 #else
 #define _MT_CODE 1
-#endif
-#else
-#define _MT_CODE 0
 #endif

 /*

Modified: tomcat/connectors/trunk/jk/xdocs/miscellaneous/ changelog.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/ xdocs/miscellaneous/changelog.xml? view=diff&rev=543093&r1=543092&r2=543093 ==================================================================== ========== --- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Thu May 31 02:27:59 2007
@@ -27,6 +27,10 @@
   <br />
   <subsection name="Native">
     <changelog>
+      <fix>
+ Always build with thread support, unless flag --enable- prefork
+      is set during for configure. (rjung)
+      </fix>
       <update>
i5/OS (AS/400) V5R4 port where Apache 2.0 modules should now use UTF8. (hgomez)
       </update>

Modified: tomcat/connectors/trunk/jk/xdocs/webserver_howto/ apache.xml URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/ xdocs/webserver_howto/apache.xml? view=diff&rev=543093&r1=543092&r2=543093 ==================================================================== ========== --- tomcat/connectors/trunk/jk/xdocs/webserver_howto/apache.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/webserver_howto/apache.xml Thu May 31 02:27:59 2007
@@ -838,25 +838,26 @@
 </screen>

 <p>
-If you want to build mod_jk for Apache 1.3 and 2.0/2.2, you should
+If you want to build mod_jk for different version of Apache httpd, like 1.3, 2.0 and 2.2,
+you need to go through the full build process for each of them.
+Please note, that httpd 2.0 and 2.2 modules are <b>not</b> compatible. The mod_jk directory +used is "apache-2.0" in both cases, but you need to compile separately.
 <ul>
 <li>
-use configure and indicate Apache 1.3 apxs location (--with-apxs)
+use configure and indicate the correct Apache httpd apxs location (--with-apxs)
 </li>
 <li>
 use make
 </li>
 <li>
-copy the mod_jk binary to the apache modules location
+copy the resulting mod_jk.so binary from the apache-1.3 or apache-2.0 subdirectory
+to the Apache httpd modules location.
 </li>
 <li>
-make clean (to remove all previously compiled modules)
+make clean (to remove all previously compiled object files)
 </li>
 <li>
-use configure and indicate Apache 2.0/2.2 apxs location,
-</li>
-<li>
-then make.
+Start over with the apxs location for your next Apache httpd version.
 </li>
 </ul>

@@ -886,17 +887,14 @@
 </tr>
   <tr valign="top"><td>--enable-prefork</td>
   <td>
-In case you build mod_jk for a multi-threaded Apache 2.0/2.2 MPM (Multi-Processing Module), +In case you build mod_jk for a multi-threaded Apache httpd 2.0/2.2 MPM (Multi-Processing Module), some areas of mod_jk code need to be synchronized to make it thread-safe.
-Configure autodetects, whether your are using a multi-threaded MPM.
-For instance, the worker MPM is multi-threaded, the prefork MPM is not.<br/> -Depending on how you build your Apache httpd, in some cases configure -detects that it needs to build thread safe, although actually it would not be necessary. -One such case is, if you build against Apache httpd with prefork MPM, -and your APR (Apache Portable Runtime) libraries have been build with thread support -(the output of "apxs -q EXTRA_CPPFLAGS" will contain "- D_REENTRANT").<br/> +Because configure can not easily detect, whether your are using a multi-threaded MPM, +mod_jk by default is always build thread-safe for Apache httpd 2.0/2.2. If you are sure, that your MPM is not multi-threaded, you can use "--enable-prefork" -to force the removal of the synchronization code (thus increasing performance a bit).</td> +to force the removal of the synchronization code (thus increasing performance a bit). +For instance, the prefork MPM is not multi-threaded. For Apache httpd 1.3
+this flag will be set automatically.</td>
 </tr>
   <tr valign="top"><td>--enable-flock</td>
   <td>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to