9 #ifndef __AFW_THREAD_H__
10 #define __AFW_THREAD_H__
31 #define afw_thread_mutex_create apr_thread_mutex_create
34 #define afw_thread_mutex_lock apr_thread_mutex_lock
37 #define afw_thread_mutex_trylock apr_thread_mutex_trylock
40 #define afw_thread_mutex_unlock apr_thread_mutex_unlock
43 #define afw_thread_mutex_destroy apr_thread_mutex_destroy
46 #define AFW_THREAD_FUNCTION APR_THREAD_FUNC
108 void *start_function_arg,
137 #define AFW_THREAD_MUTEX_LOCK(mutex, xctx) \
139 afw_thread_mutex_t *this_mutex; \
140 this_mutex = mutex; \
141 afw_thread_mutex_lock(mutex); \
151 #define AFW_THREAD_MUTEX_UNLOCK() \
153 afw_thread_mutex_unlock(this_mutex); \
#define AFW_BEGIN_DECLARES
#define AFW_DECLARE(type)
Declare a public afw function.
Interfaceafw_interface header.
struct afw_thread_attr_s afw_thread_attr_t
Typedef for afw_thread_attr.
apr_int64_t afw_integer_t
typedef for big signed int.
void *(AFW_THREAD_FUNCTION * afw_thread_function_t)(const afw_thread_t *thread, void *arg)
Typedef for thread start function.
void afw_thread_join(const afw_thread_t *thread, afw_xctx_t *xctx)
Join a thread.
#define AFW_THREAD_FUNCTION
Uses APR_THREAD_FUNC as AFW_THREAD_FUNCTION.
const afw_thread_t * afw_thread_create(afw_thread_attr_t *thread_attr, afw_thread_function_t start_function, void *start_function_arg, const afw_utf8_t *name, afw_integer_t thread_number, afw_xctx_t *xctx)
Create a thread.
afw_thread_attr_t * afw_thread_attr_create(const afw_pool_t *p, afw_xctx_t *xctx)
Create a thread attr.
Interface afw_pool public struct.
Struct for public part of afw_pool_t.
afw_integer_t thread_number
The thread number within the afw environment.
afw_xctx_t * xctx
The base xctx for the thread.
apr_thread_t * apr_thread
The associated apr thread.
const afw_pool_t * p
The thread specific pool for the thread.
afw_thread_function_t start_function
The function called when the thread starts.
const afw_utf8_t * name
The name passed on afw_thread_create().
void * start_function_arg
The arg passed to the start function.
NFC normalized UTF-8 string.
Interface afw_xctx public struct.