diff options
Diffstat (limited to 'source/kit/thread.posix.c')
-rw-r--r-- | source/kit/thread.posix.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/source/kit/thread.posix.c b/source/kit/thread.posix.c index 79a71e8..bcb089f 100644 --- a/source/kit/thread.posix.c +++ b/source/kit/thread.posix.c @@ -37,14 +37,13 @@ Implementation limits: (see EMULATED_THREADS_USE_NATIVE_TIMEDLOCK macro) */ typedef struct { - thrd_start_t func; - void *arg; - kit_allocator_t alloc; + thrd_start_t func; + void *arg; } impl_thrd_param_t; static void *impl_thrd_routine(void *p) { impl_thrd_param_t pack = *((impl_thrd_param_t *) p); - kit_alloc_dispatch(pack.alloc, KIT_DEALLOCATE, 0, 0, p); + kit_alloc_dispatch(NULL, KIT_DEALLOCATE, 0, 0, p); return (void *) (intptr_t) pack.func(pack.arg); } @@ -213,20 +212,18 @@ int thrd_create_with_stack(thrd_t *thr, thrd_start_t func, void *arg, return thrd_wrong_stack_size; attr_p = &attr; } - kit_allocator_t alloc = kit_alloc_default(); pack = (impl_thrd_param_t *) kit_alloc_dispatch( - alloc, KIT_ALLOCATE, sizeof(impl_thrd_param_t), 0, NULL); + NULL, KIT_ALLOCATE, sizeof(impl_thrd_param_t), 0, NULL); if (!pack) { if (attr_p) pthread_attr_destroy(attr_p); return thrd_nomem; } - pack->func = func; - pack->arg = arg; - pack->alloc = alloc; + pack->func = func; + pack->arg = arg; if (pthread_create(thr, attr_p, impl_thrd_routine, pack) != 0) { - kit_alloc_dispatch(alloc, KIT_DEALLOCATE, 0, 0, pack); + kit_alloc_dispatch(NULL, KIT_DEALLOCATE, 0, 0, pack); if (attr_p) pthread_attr_destroy(attr_p); return thrd_error; |