24 #include "apr_proc_mutex.h"
25 #include "apr_thread_mutex.h"
26 #include "apr_thread_rwlock.h"
42 apr_thread_mutex_t *
tm;
43 apr_thread_rwlock_t *
rw;
51 #define APR_ANYLOCK_LOCK(lck) \
52 (((lck)->type == apr_anylock_none) \
54 : (((lck)->type == apr_anylock_threadmutex) \
55 ? apr_thread_mutex_lock((lck)->lock.tm) \
56 : (((lck)->type == apr_anylock_procmutex) \
57 ? apr_proc_mutex_lock((lck)->lock.pm) \
58 : (((lck)->type == apr_anylock_readlock) \
59 ? apr_thread_rwlock_rdlock((lck)->lock.rw) \
60 : (((lck)->type == apr_anylock_writelock) \
61 ? apr_thread_rwlock_wrlock((lck)->lock.rw) \
66 #define APR_ANYLOCK_LOCK(lck) \
67 (((lck)->type == apr_anylock_none) \
69 : (((lck)->type == apr_anylock_procmutex) \
70 ? apr_proc_mutex_lock((lck)->lock.pm) \
78 #define APR_ANYLOCK_TRYLOCK(lck) \
79 (((lck)->type == apr_anylock_none) \
81 : (((lck)->type == apr_anylock_threadmutex) \
82 ? apr_thread_mutex_trylock((lck)->lock.tm) \
83 : (((lck)->type == apr_anylock_procmutex) \
84 ? apr_proc_mutex_trylock((lck)->lock.pm) \
85 : (((lck)->type == apr_anylock_readlock) \
86 ? apr_thread_rwlock_tryrdlock((lck)->lock.rw) \
87 : (((lck)->type == apr_anylock_writelock) \
88 ? apr_thread_rwlock_trywrlock((lck)->lock.rw) \
93 #define APR_ANYLOCK_TRYLOCK(lck) \
94 (((lck)->type == apr_anylock_none) \
96 : (((lck)->type == apr_anylock_procmutex) \
97 ? apr_proc_mutex_trylock((lck)->lock.pm) \
105 #define APR_ANYLOCK_UNLOCK(lck) \
106 (((lck)->type == apr_anylock_none) \
108 : (((lck)->type == apr_anylock_threadmutex) \
109 ? apr_thread_mutex_unlock((lck)->lock.tm) \
110 : (((lck)->type == apr_anylock_procmutex) \
111 ? apr_proc_mutex_unlock((lck)->lock.pm) \
112 : ((((lck)->type == apr_anylock_readlock) || \
113 ((lck)->type == apr_anylock_writelock)) \
114 ? apr_thread_rwlock_unlock((lck)->lock.rw) \
119 #define APR_ANYLOCK_UNLOCK(lck) \
120 (((lck)->type == apr_anylock_none) \
122 : (((lck)->type == apr_anylock_procmutex) \
123 ? apr_proc_mutex_unlock((lck)->lock.pm) \
Definition: apr_anylock.h:33
Definition: apr_anylock.h:36
Definition: apr_anylock.h:34
Definition: apr_anylock.h:32
apr_thread_mutex_t * tm
Definition: apr_anylock.h:42
apr_thread_rwlock_t * rw
Definition: apr_anylock.h:43
Definition: apr_anylock.h:35
apr_proc_mutex_t * pm
Definition: apr_anylock.h:40
tm_lock
Definition: apr_anylock.h:31
Definition: apr_anylock.h:39
Definition: apr_anylock.h:29
struct apr_anylock_t apr_anylock_t