00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
#ifndef APR_GLOBAL_MUTEX_H
00017
#define APR_GLOBAL_MUTEX_H
00018
00024
#include "apr.h"
00025
#include "apr_proc_mutex.h"
00026
#include "apr_pools.h"
00027
#include "apr_errno.h"
00028
#if APR_PROC_MUTEX_IS_GLOBAL
00029
#include "apr_proc_mutex.h"
00030
#endif
00031
00032
#ifdef __cplusplus
00033
extern "C" {
00034
#endif
00035
00042
#if !APR_PROC_MUTEX_IS_GLOBAL || defined(DOXYGEN)
00043
00045 typedef struct apr_global_mutex_t apr_global_mutex_t;
00046
00047
00048
00073
APR_DECLARE(apr_status_t) apr_global_mutex_create(apr_global_mutex_t **mutex,
00074 const
char *fname,
00075 apr_lockmech_e mech,
00076 apr_pool_t *pool);
00077
00089 APR_DECLARE(apr_status_t) apr_global_mutex_child_init(
00090 apr_global_mutex_t **mutex,
00091 const
char *fname,
00092 apr_pool_t *pool);
00093
00099 APR_DECLARE(apr_status_t) apr_global_mutex_lock(apr_global_mutex_t *mutex);
00100
00108 APR_DECLARE(apr_status_t) apr_global_mutex_trylock(apr_global_mutex_t *mutex);
00109
00114 APR_DECLARE(apr_status_t) apr_global_mutex_unlock(apr_global_mutex_t *mutex);
00115
00120 APR_DECLARE(apr_status_t) apr_global_mutex_destroy(apr_global_mutex_t *mutex);
00121
00126 APR_POOL_DECLARE_ACCESSOR(global_mutex);
00127
00128 #else
00129
00130
00131
00132
00133
00134
00135 #define apr_global_mutex_t
apr_proc_mutex_t
00136 #define apr_global_mutex_create apr_proc_mutex_create
00137 #define apr_global_mutex_child_init apr_proc_mutex_child_init
00138 #define apr_global_mutex_lock apr_proc_mutex_lock
00139 #define apr_global_mutex_trylock apr_proc_mutex_trylock
00140 #define apr_global_mutex_unlock apr_proc_mutex_unlock
00141 #define apr_global_mutex_destroy apr_proc_mutex_destroy
00142 #define apr_global_mutex_pool_get apr_proc_mutex_pool_get
00143
00144 #endif
00145
00148 #ifdef __cplusplus
00149 }
00150 #endif
00151
00152 #endif