Author: mturk Date: Tue Mar 20 01:15:49 2007 New Revision: 520310 URL: http://svn.apache.org/viewvc?view=rev&rev=520310 Log: Add --enable-flock configure param for explicit compilation of flock() for shared memory locks
Modified: tomcat/connectors/trunk/jk/native/common/jk_mt.h tomcat/connectors/trunk/jk/native/configure.in 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=520310&r1=520309&r2=520310 ============================================================================== --- tomcat/connectors/trunk/jk/native/common/jk_mt.h (original) +++ tomcat/connectors/trunk/jk/native/common/jk_mt.h Tue Mar 20 01:15:49 2007 @@ -96,7 +96,15 @@ #include <unistd.h> #include <fcntl.h> + +#define USE_FLOCK_LK 0 #if HAVE_FLOCK +#ifdef JK_USE_FLOCK +#define USE_FLOCK_LK 1 +#endif +#endif + +#if USE_FLOCK_LK #include <sys/file.h> #define JK_ENTER_LOCK(x, rc) \ @@ -111,7 +119,7 @@ rc = rc == 0 ? JK_TRUE : JK_FALSE; \ } while (0) -#else +#else /* !USE_FLOCK_LK */ #define JK_ENTER_LOCK(x, rc) \ do { \ @@ -136,7 +144,8 @@ while ((rc = fcntl((x), F_SETLKW, &_fl) < 0) && (errno == EINTR)); \ rc = rc == 0 ? JK_TRUE : JK_FALSE; \ } while (0) -#endif /* HAVE_FLOCK */ + +#endif /* USE_FLOCK_LK */ #else /* WIN32 || NETWARE */ #define JK_ENTER_LOCK(x, rc) rc = JK_TRUE Modified: tomcat/connectors/trunk/jk/native/configure.in URL: http://svn.apache.org/viewvc/tomcat/connectors/trunk/jk/native/configure.in?view=diff&rev=520310&r1=520309&r2=520310 ============================================================================== --- tomcat/connectors/trunk/jk/native/configure.in (original) +++ tomcat/connectors/trunk/jk/native/configure.in Tue Mar 20 01:15:49 2007 @@ -407,6 +407,22 @@ ]) AC_SUBST(CFLAGS) +dnl CFLAGS for shared memory lock mode +dnl it also allows the CFLAGS environment variable. +CFLAGS="${CFLAGS}" +AC_ARG_ENABLE( +prefork, +[ --enable-flock Turn on flock for shared locking if present], +[ +case "${enableval}" in + y | Y | YES | yes | TRUE | true ) + CFLAGS="${CFLAGS} -DJK_USE_FLOCK" + AC_MSG_RESULT([...Enabling flock() shared memory locking...]) + ;; +esac +]) +AC_SUBST(CFLAGS) + dnl the APXSCFLAGS is given by apxs to the C compiler dnl the APXSLDFLAGS is given to the linker (for APRVARS). dnl APXSLDFLAGS="" 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=520310&r1=520309&r2=520310 ============================================================================== --- tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/miscellaneous/changelog.xml Tue Mar 20 01:15:49 2007 @@ -26,6 +26,13 @@ <br /> <subsection name="Native"> <changelog> + <update> + Apache. Add --enable-flock configure parameter for explicit + compilation of faster flock() system calls for OS supporting + those calls. By default the fcntl system call for locking will + be used that is a little bit slower but it can work on NFS + mounted volumes as well. (mturk) + </update> <fix> <bug>41562</bug>: Add Debug logging for read from client in ISAPI Redirector. Contributed by Tim Whittington. (mturk) 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=520310&r1=520309&r2=520310 ============================================================================== --- tomcat/connectors/trunk/jk/xdocs/webserver_howto/apache.xml (original) +++ tomcat/connectors/trunk/jk/xdocs/webserver_howto/apache.xml Tue Mar 20 01:15:49 2007 @@ -869,6 +869,14 @@ 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> </tr> + <tr valign="top"><td>--enable-flock</td> + <td> +In case the Operating system supports flock system call use this flag to enable this +faster locks that are implemented as system call instead emulated by GNU C library.<br/> +However those locks does not work on NFS mounted volumes, so you can use +"--enable-flock" during compile time to force the flocks() calls.</td> +</tr> + </table> <br/> <table> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]