apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/locks/unix global_mutex.c
Date Thu, 02 May 2002 00:52:01 GMT
rbb         02/05/01 17:52:01

  Modified:    include  apr_portable.h
               locks/unix global_mutex.c
  Log:
  Add apr_os_get function for global_mutexes.
  
  Revision  Changes    Path
  1.78      +19 -0     apr/include/apr_portable.h
  
  Index: apr_portable.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_portable.h,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- apr_portable.h	9 Apr 2002 06:56:55 -0000	1.77
  +++ apr_portable.h	2 May 2002 00:52:01 -0000	1.78
  @@ -74,6 +74,7 @@
   #include "apr_file_io.h"
   #include "apr_network_io.h"
   #include "apr_errno.h"
  +#include "apr_global_mutex.h"
   #include "apr_proc_mutex.h"
   #include "apr_time.h"
   #include "apr_dso.h"
  @@ -216,6 +217,24 @@
   };
   
   typedef struct apr_os_sock_info_t apr_os_sock_info_t;
  +
  +#if APR_PROCESS_LOCK_IS_GLOBAL
  +#define apr_os_global_mutex_t apr_os_proc_mutex_t
  +#define apr_os_global_mutex_get apr_os_proc_mutex_get
  +#else
  +    struct apr_os_global_mutex_t {
  +        apr_pool_t *pool;
  +        apr_proc_mutex_t *proc_mutex;
  +#if APR_HAS_THREADS
  +        apr_thread_mutex_t *thread_mutex;
  +#endif /* APR_HAS_THREADS */
  +    };
  +    typedef struct apr_os_global_mutex_t apr_os_global_mutex_t;
  +
  +APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex, 
  +                                                apr_global_mutex_t *pmutex);
  +#endif
  +
   
   /**
    * convert the file from apr type to os specific type.
  
  
  
  1.5       +12 -0     apr/locks/unix/global_mutex.c
  
  Index: global_mutex.c
  ===================================================================
  RCS file: /home/cvs/apr/locks/unix/global_mutex.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- global_mutex.c	13 Mar 2002 20:39:21 -0000	1.4
  +++ global_mutex.c	2 May 2002 00:52:01 -0000	1.5
  @@ -57,6 +57,7 @@
   #include "global_mutex.h"
   #include "apr_proc_mutex.h"
   #include "apr_thread_mutex.h"
  +#include "apr_portable.h"
   
   static apr_status_t global_mutex_cleanup(void *data)
   {
  @@ -175,6 +176,17 @@
           }
       }
   #endif /* APR_HAS_THREADS */
  +    return APR_SUCCESS;
  +}
  +
  +APR_DECLARE(apr_status_t) apr_os_global_mutex_get(apr_os_global_mutex_t *ospmutex,
  +                                                apr_global_mutex_t *pmutex)
  +{
  +    ospmutex->pool = pmutex->pool;
  +    ospmutex->proc_mutex = pmutex->proc_mutex;
  +#if APR_HAS_THREADS
  +    ospmutex->thread_mutex = pmutex->thread_mutex;
  +#endif
       return APR_SUCCESS;
   }
   
  
  
  

Mime
View raw message