apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/locks/unix proc_mutex.c
Date Thu, 09 May 2002 18:56:43 GMT
trawick     02/05/09 11:56:43

  Modified:    .        CHANGES acconfig.h configure.in
               build    apr_hints.m4
               locks/unix proc_mutex.c
  Log:
  Fix a problem with global mutexes on OS/390 when something other
  than the default mechanism (fcntl) was used.  The mutexes didn't
  necessarily block out other threads in the same process.
  
  This commit also adds the infrastructure to allow any individual
  process mutex mechanism to be declared as global for a platform
  so that APR doesn't wastefully use an extra thread mutex for any
  operations on a global mutex based on that process mutex
  mechanism.
  
  Revision  Changes    Path
  1.281     +5 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.280
  retrieving revision 1.281
  diff -u -r1.280 -r1.281
  --- CHANGES	8 May 2002 05:22:04 -0000	1.280
  +++ CHANGES	9 May 2002 18:56:43 -0000	1.281
  @@ -1,5 +1,10 @@
   Changes with APR b1
   
  +  *) Fix a problem with global mutexes on OS/390 when something other
  +     than the default mechanism (fcntl) was used.  The mutexes didn't
  +     necessarily block out other threads in the same process.
  +     [Jeff Trawick]
  +
     *) Fixed apr_strfsize formatting of values over 1 gig
        [Matsuzaki Yoshinobu <maz@iij.ad.jp>]
   
  
  
  
  1.55      +5 -0      apr/acconfig.h
  
  Index: acconfig.h
  ===================================================================
  RCS file: /home/cvs/apr/acconfig.h,v
  retrieving revision 1.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- acconfig.h	8 Jan 2002 06:22:26 -0000	1.54
  +++ acconfig.h	9 May 2002 18:56:43 -0000	1.55
  @@ -25,6 +25,11 @@
   #undef USE_PROC_PTHREAD_SERIALIZE
   #undef USE_PTHREAD_SERIALIZE
   
  +#undef POSIXSEM_IS_GLOBAL
  +#undef SYSVSEM_IS_GLOBAL
  +#undef FCNTL_IS_GLOBAL
  +#undef FLOCK_IS_GLOBAL
  +
   #undef READDIR_IS_THREAD_SAFE
   #undef GETHOSTBYNAME_IS_THREAD_SAFE
   #undef GETHOSTBYADDR_IS_THREAD_SAFE
  
  
  
  1.447     +33 -1     apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.446
  retrieving revision 1.447
  diff -u -r1.446 -r1.447
  --- configure.in	7 May 2002 04:12:43 -0000	1.446
  +++ configure.in	9 May 2002 18:56:43 -0000	1.447
  @@ -1474,7 +1474,7 @@
   AC_SUBST(procpthreadser)
   AC_SUBST(pthreadser)
   
  -AC_MSG_CHECKING(if interprocess lock affects threads)
  +AC_MSG_CHECKING(if all interprocess locks affect threads)
   if test "x$apr_process_lock_is_global" = "xyes"; then
       proclockglobal="1"
       AC_MSG_RESULT(yes)
  @@ -1484,6 +1484,38 @@
   fi
   
   AC_SUBST(proclockglobal)
  +
  +AC_MSG_CHECKING(if Posix sems affect threads in the same process)
  +if test "x$apr_posixsem_is_global" = "xyes"; then
  +  AC_DEFINE(POSIXSEM_IS_GLOBAL)
  +  AC_MSG_RESULT(yes)
  +else
  +  AC_MSG_RESULT(no)
  +fi
  +
  +AC_MSG_CHECKING(if SysV sems affect threads in the same process)
  +if test "x$apr_sysvsem_is_global" = "xyes"; then
  +  AC_DEFINE(SYSVSEM_IS_GLOBAL)
  +  AC_MSG_RESULT(yes)
  +else
  +  AC_MSG_RESULT(no)
  +fi
  +
  +AC_MSG_CHECKING(if fcntl locks affect threads in the same process)
  +if test "x$apr_fcntl_is_global" = "xyes"; then
  +  AC_DEFINE(FCNTL_IS_GLOBAL)
  +  AC_MSG_RESULT(yes)
  +else
  +  AC_MSG_RESULT(no)
  +fi
  +
  +AC_MSG_CHECKING(if flock locks affect threads in the same process)
  +if test "x$apr_flock_is_global" = "xyes"; then
  +  AC_DEFINE(FLOCK_IS_GLOBAL)
  +  AC_MSG_RESULT(yes)
  +else
  +  AC_MSG_RESULT(no)
  +fi
   
   dnl #----------------------------- Checking for /dev/random 
   AC_MSG_CHECKING(for /dev/random)
  
  
  
  1.41      +1 -1      apr/build/apr_hints.m4
  
  Index: apr_hints.m4
  ===================================================================
  RCS file: /home/cvs/apr/build/apr_hints.m4,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- apr_hints.m4	13 Apr 2002 13:51:26 -0000	1.40
  +++ apr_hints.m4	9 May 2002 18:56:43 -0000	1.41
  @@ -355,7 +355,7 @@
   	;;
       *-ibm-os390)
          APR_SETIFNULL(apr_lock_method, [USE_SYSVSEM_SERIALIZE])
  -       APR_SETIFNULL(apr_process_lock_is_global, [yes])
  +       APR_SETIFNULL(apr_sysvsem_is_global, [yes])
          APR_SETIFNULL(apr_gethostbyname_is_thread_safe, [yes])
          APR_SETIFNULL(apr_gethostbyaddr_is_thread_safe, [yes])
          APR_ADDTO(CPPFLAGS, [-U_NO_PROTO -DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO
-DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
  
  
  
  1.17      +4 -4      apr/locks/unix/proc_mutex.c
  
  Index: proc_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/proc_mutex.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- proc_mutex.c	9 Apr 2002 06:56:56 -0000	1.16
  +++ proc_mutex.c	9 May 2002 18:56:43 -0000	1.17
  @@ -167,7 +167,7 @@
   
   const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_posix_methods =
   {
  -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS
  +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(POSIXSEM_IS_GLOBAL)
       APR_PROCESS_LOCK_MECH_IS_GLOBAL,
   #else
       0,
  @@ -282,7 +282,7 @@
   
   const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_sysv_methods =
   {
  -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS
  +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(SYSVSEM_IS_GLOBAL)
       APR_PROCESS_LOCK_MECH_IS_GLOBAL,
   #else
       0,
  @@ -591,7 +591,7 @@
   
   const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_fcntl_methods =
   {
  -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS
  +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FCNTL_IS_GLOBAL)
       APR_PROCESS_LOCK_MECH_IS_GLOBAL,
   #else
       0,
  @@ -720,7 +720,7 @@
   
   const apr_proc_mutex_unix_lock_methods_t apr_proc_mutex_unix_flock_methods =
   {
  -#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS
  +#if APR_PROCESS_LOCK_IS_GLOBAL || !APR_HAS_THREADS || defined(FLOCK_IS_GLOBAL)
       APR_PROCESS_LOCK_MECH_IS_GLOBAL,
   #else
       0,
  
  
  

Mime
View raw message