You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2002/02/22 08:09:26 UTC

cvs commit: apr/include apr.h.in apr.hnw apr.hw apr_global_mutex.h

wrowe       02/02/21 23:09:26

  Modified:    include  apr.h.in apr.hnw apr.hw apr_global_mutex.h
  Log:
    Per Aaron's consent that there is no more rational way to optimize this
    relationship - allow Win32/Netware [and perhaps, some unix-ish platforms
    that don't have a 'proc lock not typesafe' construct] to 'borrow' the
    proc_mutex code.  Because the apr_thread_lock_create call differs so
    significantly, global locks can never be implemented in terms of thread
    locks [as well as the converse.]
  
  Revision  Changes    Path
  1.101     +3 -0      apr/include/apr.h.in
  
  Index: apr.h.in
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.h.in,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- apr.h.in	21 Feb 2002 23:34:10 -0000	1.100
  +++ apr.h.in	22 Feb 2002 07:09:26 -0000	1.101
  @@ -258,6 +258,9 @@
   /* are we going to force the generic atomic operations */
   #define APR_FORCE_ATOMIC_GENERIC @apr_force_atomic_generic@
   
  +/* ### aught to actual deploy this for OS2? */
  +#define APR_PROC_MUTEX_IS_GLOBAL      0
  +
   /* Local machine definition for console and log output. */
   #define APR_EOL_STR              "@eolstr@"
   
  
  
  
  1.7       +2 -0      apr/include/apr.hnw
  
  Index: apr.hnw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hnw,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apr.hnw	8 Feb 2002 19:14:30 -0000	1.6
  +++ apr.hnw	22 Feb 2002 07:09:26 -0000	1.7
  @@ -256,6 +256,8 @@
         #define LOBYTE      NGetLo8
   #endif
   
  +/* PROC mutex is a GLOBAL mutex on Netware */
  +#define APR_PROC_MUTEX_IS_GLOBAL      1
   
   /* Definitions that APR programs need to work properly. */
   
  
  
  
  1.89      +3 -0      apr/include/apr.hw
  
  Index: apr.hw
  ===================================================================
  RCS file: /home/cvs/apr/include/apr.hw,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- apr.hw	18 Feb 2002 05:45:45 -0000	1.88
  +++ apr.hw	22 Feb 2002 07:09:26 -0000	1.89
  @@ -410,6 +410,9 @@
   /* Local machine definition for console and log output. */
   #define APR_EOL_STR              "\r\n"
   
  +/* No difference between PROC and GLOBAL mutex */
  +#define APR_PROC_MUTEX_IS_GLOBAL      1
  +
   typedef int apr_wait_t;
   
   /* struct iovec is needed to emulate Unix writev */
  
  
  
  1.2       +20 -0     apr/include/apr_global_mutex.h
  
  Index: apr_global_mutex.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_global_mutex.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- apr_global_mutex.h	18 Feb 2002 01:16:03 -0000	1.1
  +++ apr_global_mutex.h	22 Feb 2002 07:09:26 -0000	1.2
  @@ -75,6 +75,8 @@
    * @{
    */
   
  +#if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
  +
   typedef struct apr_global_mutex_t apr_global_mutex_t;
   
   /*   Function definitions */
  @@ -156,6 +158,24 @@
    * @return apr_pool_t the pool
    */
   APR_POOL_DECLARE_ACCESSOR(global_mutex);
  +
  +#else /* APR_PROC_MUTEX_IS_GLOBAL */
  +
  +/* Some platforms [e.g. Win32] have cross process locks that are truly
  + * global locks, since there isn't the concept of cross-process locks.
  + * Define these platforms in terms of an apr_proc_mutex_t.
  + */
  +
  +#define apr_global_mutex_t          apr_proc_mutex_t
  +#define apr_global_mutex_create     apr_proc_mutex_create
  +#define apr_global_mutex_child_init apr_proc_mutex_child_init
  +#define apr_global_mutex_lock       apr_proc_mutex_lock
  +#define apr_global_mutex_trylock    apr_proc_mutex_trylock
  +#define apr_global_mutex_unlock     apr_proc_mutex_unlock
  +#define apr_global_mutex_destroy    apr_proc_mutex_destroy
  +#define apr_global_mutex_pool_get   apr_proc_mutex_pool_get
  +
  +#endif
   
   #ifdef __cplusplus
   }