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) \
struct apr_anylock_t apr_anylock_t
APR Process Locking Routines.
APR Thread Mutex Routines.
APR Reader/Writer Lock Routines.
Definition: apr_anylock.h:29
union apr_anylock_t::apr_anylock_u_t lock
tm_lock
Definition: apr_anylock.h:31
@ apr_anylock_procmutex
Definition: apr_anylock.h:33
@ apr_anylock_readlock
Definition: apr_anylock.h:35
@ apr_anylock_writelock
Definition: apr_anylock.h:36
@ apr_anylock_none
Definition: apr_anylock.h:32
@ apr_anylock_threadmutex
Definition: apr_anylock.h:34
enum apr_anylock_t::tm_lock type
Definition: apr_arch_proc_mutex.h:27
Definition: apr_arch_thread_mutex.h:28
Definition: apr_arch_thread_rwlock.h:28
Definition: apr_anylock.h:39
apr_thread_rwlock_t * rw
Definition: apr_anylock.h:43
apr_proc_mutex_t * pm
Definition: apr_anylock.h:40
apr_thread_mutex_t * tm
Definition: apr_anylock.h:42