From d6f368a3f400fea3e89280262a8147e7ce5d855c Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 22 Aug 2019 00:59:49 +0200 Subject: Move thread work from compiler/parser to thread_work file, fix use after free bug in multithreaded parser allocator --- src/std/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/std/thread.c') diff --git a/src/std/thread.c b/src/std/thread.c index fb0e9ab..87362d2 100644 --- a/src/std/thread.c +++ b/src/std/thread.c @@ -107,13 +107,13 @@ int amal_thread_join(amal_thread *self, void **result) { return 0; } -void amal_mutex_init(amal_mutex *self) { - pthread_mutex_init(&self->mutex, NULL); +int amal_mutex_init(amal_mutex *self) { #ifdef AMAL_MUTEX_DEBUG self->lock_identifier = NULL; #endif self->locked = bool_false; self->owner_thread = 0; + return pthread_mutex_init(&self->mutex, NULL); } void amal_mutex_deinit(amal_mutex *self) { -- cgit v1.2.3