10 #define __AFW_LOCK_H__
31 afw_lock_type_global_mutex,
32 afw_lock_type_process_mutex,
33 afw_lock_type_thread_mutex,
34 afw_lock_type_thread_recursive_mutex,
35 afw_lock_type_thread_read_write
116 afw_lock_create_environment_lock(
145 #ifdef AFW_LOCK_DEBUG
146 #define afw_lock_obtain(instance,xctx) \
147 afw_lock_obtain_debug(instance, xctx, AFW__FILE_LINE__)
172 #ifdef AFW_LOCK_DEBUG
173 #define afw_lock_release(instance,xctx) \
174 afw_lock_release_debug(instance, xctx, AFW__FILE_LINE__)
191 #define AFW_LOCK_BEGIN(instance) \
192 const afw_lock_t *this_LOCK = instance; \
193 afw_lock_obtain(this_LOCK, xctx); \
202 #define AFW_LOCK_END \
204 afw_lock_release(this_LOCK, xctx); \
263 #ifdef AFW_LOCK_DEBUG
264 #define afw_lock_read_obtain(instance,xctx) \
265 afw_lock_read_obtain_debug(instance, xctx, AFW__FILE_LINE__)
290 #ifdef AFW_LOCK_DEBUG
291 #define afw_lock_read_release(instance,xctx) \
292 afw_lock_read_release_debug(instance, xctx, AFW__FILE_LINE__)
309 #define AFW_LOCK_READ_BEGIN(instance) \
310 const afw_lock_rw_t *this_LOCK = instance; \
311 afw_lock_read_obtain(this_LOCK, xctx); \
320 #define AFW_LOCK_READ_END \
322 afw_lock_read_release(this_LOCK, xctx); \
351 #ifdef AFW_LOCK_DEBUG
352 #define afw_lock_write_obtain(instance,xctx) \
353 afw_lock_write_obtain_debug(instance, xctx, AFW__FILE_LINE__)
381 #ifdef AFW_LOCK_DEBUG
382 #define afw_lock_write_release(instance,xctx) \
383 afw_lock_write_release_debug(instance, xctx, AFW__FILE_LINE__)
400 #define AFW_LOCK_WRITE_BEGIN(instance) \
401 const afw_lock_rw_t *this_LOCK = instance; \
402 afw_lock_write_obtain(this_LOCK, xctx); \
411 #define AFW_LOCK_WRITE_END \
413 afw_lock_write_release(this_LOCK, xctx); \
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
afw_utf8_octet_t afw_utf8_z_t
NFC normalized UTF-8 null terminated string.
apr_size_t afw_size_t
size_t.
void afw_lock_write_obtain_debug(const afw_lock_rw_t *instance, afw_xctx_t *xctx, const afw_utf8_z_t *source_z)
Debug version of obtain write lock.
const afw_lock_rw_t * afw_lock_create_rw_and_register(const afw_utf8_t *lock_id, const afw_utf8_t *brief, const afw_utf8_t *description, afw_xctx_t *xctx)
Create a read/write lock and register in environment.
void afw_lock_release(const afw_lock_t *instance, afw_xctx_t *xctx)
Release lock.
const afw_lock_t * afw_lock_create_and_register(const afw_utf8_t *lock_id, const afw_utf8_t *brief, const afw_utf8_t *description, afw_boolean_t insure_recursive_lock, afw_xctx_t *xctx)
Create a lock and register in environment.
void afw_lock_release_debug(const afw_lock_t *instance, afw_xctx_t *xctx, const afw_utf8_z_t *source_z)
Debug version of release lock.
void afw_lock_read_release(const afw_lock_rw_t *instance, afw_xctx_t *xctx)
Release read lock.
void afw_lock_write_release(const afw_lock_rw_t *instance, afw_xctx_t *xctx)
Release write lock.
void afw_lock_write_obtain(const afw_lock_rw_t *instance, afw_xctx_t *xctx)
Obtain write lock.
const afw_lock_rw_t * afw_lock_create_rw(const afw_utf8_t *lock_id, const afw_utf8_t *brief, const afw_utf8_t *description, const afw_pool_t *p, afw_xctx_t *xctx)
Create a read/write lock that will last for life of pool.
void afw_lock_read_obtain_debug(const afw_lock_rw_t *instance, afw_xctx_t *xctx, const afw_utf8_z_t *source_z)
Debug version of obtain read lock.
void afw_lock_obtain(const afw_lock_t *instance, afw_xctx_t *xctx)
Obtain lock.
void afw_lock_write_release_debug(const afw_lock_rw_t *instance, afw_xctx_t *xctx, const afw_utf8_z_t *source_z)
Debug version of release write lock.
void afw_lock_read_obtain(const afw_lock_rw_t *instance, afw_xctx_t *xctx)
Obtain read lock.
void afw_lock_read_release_debug(const afw_lock_rw_t *instance, afw_xctx_t *xctx, const afw_utf8_z_t *source_z)
Debug version of release read lock.
void afw_lock_obtain_debug(const afw_lock_t *instance, afw_xctx_t *xctx, const afw_utf8_z_t *source_z)
Debug version of obtain lock.
const afw_lock_t * afw_lock_create(const afw_utf8_t *lock_id, const afw_utf8_t *brief, const afw_utf8_t *description, afw_boolean_t insure_recursive_lock, const afw_pool_t *p, afw_xctx_t *xctx)
Create a lock that will last for life of pool.
afw_lock_type_t
Lock type.
apr_thread_rwlock_t * rwlock
for type thread_read_write
apr_thread_mutex_t * mutex
for type thread_mutex
Interface afw_pool public struct.
NFC normalized UTF-8 string.
Interface afw_xctx public struct.