22 apr_threadattr_t *attr;
30 static void* APR_THREAD_FUNC
31 impl_thread_start(apr_thread_t *thd,
void *data)
44 void *start_function_arg,
52 self = afw_pool_internal_create_thread(-1, xctx);
53 self->thread_attr = thread_attr;
54 self->start_function = start_function;
55 self->start_function_arg = start_function_arg;
57 self->thread_number = thread_number;
58 self->xctx = afw_xctx_internal_create_thread_xctx(
self, xctx);
60 rv = apr_thread_create(&self->apr_thread, (apr_threadattr_t *)thread_attr,
62 if (rv != APR_SUCCESS) {
64 "apr_thread_create() failed", xctx);
77 rv = apr_thread_join(&rv2, thread->apr_thread);
78 if (rv != APR_SUCCESS) {
80 "apr_thread_join() failed", xctx);
82 if (rv2 != APR_SUCCESS) {
84 "apr_thread_join() dead thread error", xctx);
AFW_DEFINE(const afw_object_t *)
Adaptive Framework Core Internal.
void *(AFW_THREAD_FUNCTION * afw_thread_function_t)(const afw_thread_t *thread, void *arg)
Typedef for thread start function.
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.
#define AFW_THROW_ERROR_RV_Z(code, rv_source_id, rv, message_z, xctx)
Macro used to set error and rv in xctx and throw it.
#define afw_pool_get_apr_pool(instance)
Call method get_apr_pool of interface afw_pool.
afw_thread_join(const afw_thread_t *thread, afw_xctx_t *xctx)
Join a thread.
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_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_thread_function_t start_function
The function called when the thread starts.
NFC normalized UTF-8 string.
Interface afw_xctx public struct.