apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/include/arch/unix locks.h
Date Tue, 26 Jun 2001 15:07:34 GMT
trawick     01/06/26 08:07:34

  Modified:    .        configure.in
               include  apr.h.in apr.hw
               include/arch/unix locks.h
  Log:
  Export APR_HAS_foo_SERIALIZE symbols from APR so apps can tell which lock
  mechanisms are available.
  
  Revision  Changes    Path
  1.318     +16 -1     apr/configure.in
  
  Index: configure.in
  ===================================================================
  RCS file: /home/cvs/apr/configure.in,v
  retrieving revision 1.317
  retrieving revision 1.318
  diff -u -r1.317 -r1.318
  --- configure.in	2001/06/26 02:04:55	1.317
  +++ configure.in	2001/06/26 15:07:20	1.318
  @@ -938,11 +938,22 @@
       APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
   fi
   
  +# See which lock mechanisms we can support on this system.
  +hassysvser="0"
  +hasflockser="0"
  +hasfcntlser="0"
  +hasprocpthreadser="0"
  +APR_IFALLYES(func:semget func:semctl, hassysvser="1")
  +APR_IFALLYES(func:flock define:LOCK_EX, hasflockser="1")
  +APR_IFALLYES(header:fcntl.h define:F_SETLK, hasfcntlser="1")
  +APR_IFALLYES(header:pthread.h define:PTHREAD_PROCESS_SHARED, hasprocpthreadser="1")
  +
  +# See which lock mechanism we'll select by default on this system.
   # The last APR_DECIDE to execute sets the default
   APR_BEGIN_DECISION([apr_lock implementation method])
   APR_IFALLYES(func:semget func:semctl,
               APR_DECIDE(USE_SYSVSEM_SERIALIZE, [SysV IPC semget()]))
  -APR_IFALLYES(header:sys/file.h define:LOCK_EX,
  +APR_IFALLYES(func:flock define:LOCK_EX,
               APR_DECIDE(USE_FLOCK_SERIALIZE, [4.2BSD-style flock()]))
   APR_IFALLYES(header:fcntl.h define:F_SETLK,
               APR_DECIDE(USE_FCNTL_SERIALIZE, [SVR4-style fcntl()]))
  @@ -980,6 +991,10 @@
     lockcreatenp="1"
   fi
   
  +AC_SUBST(hasflockser)
  +AC_SUBST(hassysvser)
  +AC_SUBST(hasfcntlser)
  +AC_SUBST(hasprocpthreadser)
   AC_SUBST(flockser)
   AC_SUBST(sysvser)
   AC_SUBST(fcntlser)
  
  
  
  1.85      +5 -0      apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.h.in,v
  retrieving revision 1.84
  retrieving revision 1.85
  diff -u -r1.84 -r1.85
  --- apr.h.in	2001/06/26 02:04:58	1.84
  +++ apr.h.in	2001/06/26 15:07:25	1.85
  @@ -64,6 +64,11 @@
   #define APR_USE_PROC_PTHREAD_SERIALIZE    @procpthreadser@ 
   #define APR_USE_PTHREAD_SERIALIZE         @pthreadser@ 
   
  +#define APR_HAS_FLOCK_SERIALIZE           @hasflockser@
  +#define APR_HAS_SYSVSEM_SERIALIZE         @hassysvser@
  +#define APR_HAS_FCNTL_SERIALIZE           @hasfcntlser@
  +#define APR_HAS_PROC_PTHREAD_SERIALIZE    @hasprocpthreadser@
  +
   #define APR_HAS_LOCK_CREATE_NP            @lockcreatenp@
   
   #define APR_PROCESS_LOCK_IS_GLOBAL        @proclockglobal@
  
  
  
  1.70      +5 -0      apr/include/apr.hw
  
  Index: apr.hw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hw,v
  retrieving revision 1.69
  retrieving revision 1.70
  diff -u -r1.69 -r1.70
  --- apr.hw	2001/06/26 02:04:59	1.69
  +++ apr.hw	2001/06/26 15:07:26	1.70
  @@ -157,6 +157,11 @@
   #define APR_USE_PROC_PTHREAD_SERIALIZE    0 
   #define APR_USE_PTHREAD_SERIALIZE         0 
   
  +#define APR_HAS_FLOCK_SERIALIZE           0
  +#define APR_HAS_SYSVSEM_SERIALIZE         0
  +#define APR_HAS_FCNTL_SERIALIZE           0
  +#define APR_HAS_PROC_PTHREAD_SERIALIZE    0
  +
   #define APR_HAS_LOCK_CREATE_NP            0
   
   #define APR_PROCESS_LOCK_IS_GLOBAL        0
  
  
  
  1.33      +4 -19     apr/include/arch/unix/locks.h
  
  Index: locks.h
  ===================================================================
  RCS file: /home/cvs/apr/include/arch/unix/locks.h,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- locks.h	2001/06/26 00:22:08	1.32
  +++ locks.h	2001/06/26 15:07:31	1.33
  @@ -109,32 +109,17 @@
   };
   typedef struct apr_unix_lock_methods_t apr_unix_lock_methods_t;
   
  -#if defined(HAVE_SEMCTL) && defined(HAVE_SEMGET)
  -#define APR_HAS_SYSVSEM_SERIALIZE      1
  +#if APR_HAS_SYSVSEM_SERIALIZE
   extern const apr_unix_lock_methods_t apr_unix_sysv_methods;
  -#else
  -#define APR_HAS_SYSVSEM_SERIALIZE      0
   #endif
  -
  -#if defined(HAVE_FCNTL_H) && defined(HAVE_F_SETLK)
  -#define APR_HAS_FCNTL_SERIALIZE        1
  +#if APR_HAS_FCNTL_SERIALIZE
   extern const apr_unix_lock_methods_t apr_unix_fcntl_methods;
  -#else
  -#define APR_HAS_FCNTL_SERIALIZE        0
   #endif
  -
  -#if defined(HAVE_FLOCK) && defined(HAVE_LOCK_EX)
  -#define APR_HAS_FLOCK_SERIALIZE        1
  +#if APR_HAS_FLOCK_SERIALIZE
   extern const apr_unix_lock_methods_t apr_unix_flock_methods;
  -#else
  -#define APR_HAS_FLOCK_SERIALIZE        0
   #endif
  -
  -#if defined(HAVE_PTHREAD_H) && defined(HAVE_PTHREAD_PROCESS_SHARED) &&
defined(HAVE_PTHREAD_MUTEXATTR_SETPSHARED)
  -#define APR_HAS_PROC_PTHREAD_SERIALIZE 1
  +#if APR_HAS_PROC_PTHREAD_SERIALIZE
   extern const apr_unix_lock_methods_t apr_unix_proc_pthread_methods;
  -#else
  -#define APR_HAS_PROC_PTHREAD_SERIALIZE 0
   #endif
   
   #if defined(HAVE_PTHREAD_RWLOCK_INIT)
  
  
  

Mime
View raw message