APR-Util transparent any lock flavor wrapper.
More...
#include "apr_proc_mutex.h"
#include "apr_thread_mutex.h"
#include "apr_thread_rwlock.h"
Go to the source code of this file.
APR-Util transparent any lock flavor wrapper.
#define APR_ANYLOCK_LOCK |
( |
|
lck | ) |
|
Value:(((lck)->type == apr_anylock_none) \
? APR_SUCCESS \
: (((lck)->type == apr_anylock_threadmutex) \
? apr_thread_mutex_lock((lck)->lock.tm) \
: (((lck)->type == apr_anylock_procmutex) \
? apr_proc_mutex_lock((lck)->lock.pm) \
: (((lck)->type == apr_anylock_readlock) \
? apr_thread_rwlock_rdlock((lck)->lock.rw) \
: (((lck)->type == apr_anylock_writelock) \
? apr_thread_rwlock_wrlock((lck)->lock.rw) \
: APR_EINVAL)))))
Lock an apr_anylock_t structure
#define APR_ANYLOCK_TRYLOCK |
( |
|
lck | ) |
|
Value:(((lck)->type == apr_anylock_none) \
? APR_SUCCESS \
: (((lck)->type == apr_anylock_threadmutex) \
? apr_thread_mutex_trylock((lck)->lock.tm) \
: (((lck)->type == apr_anylock_procmutex) \
? apr_proc_mutex_trylock((lck)->lock.pm) \
: (((lck)->type == apr_anylock_readlock) \
? apr_thread_rwlock_tryrdlock((lck)->lock.rw) \
: (((lck)->type == apr_anylock_writelock) \
? apr_thread_rwlock_trywrlock((lck)->lock.rw) \
: APR_EINVAL)))))
Try to lock an apr_anylock_t structure
#define APR_ANYLOCK_UNLOCK |
( |
|
lck | ) |
|
Value:(((lck)->type == apr_anylock_none) \
? APR_SUCCESS \
: (((lck)->type == apr_anylock_threadmutex) \
? apr_thread_mutex_unlock((lck)->lock.tm) \
: (((lck)->type == apr_anylock_procmutex) \
? apr_proc_mutex_unlock((lck)->lock.pm) \
: ((((lck)->type == apr_anylock_readlock) || \
((lck)->type == apr_anylock_writelock)) \
? apr_thread_rwlock_unlock((lck)->lock.rw) \
: APR_EINVAL))))
Unlock an apr_anylock_t structure
Structure that may contain any APR lock type