From 1e3a34ddf33b3ce0421c818f1937b016651982f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Mon, 16 Oct 2023 17:20:31 +0200 Subject: [PATCH] lock for OSX / temp / --- engine/joint/v4k.h | 2 ++ engine/split/v4k_cooker.c | 2 ++ engine/v4k.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 084f552..057b76f 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -335461,11 +335461,13 @@ int cook_async( void *userdata ) { // tcc: only a single running thread shall pass, because of racing shared state due to missing thread_local support at compiler level ifdef(tcc, thread_mutex_lock( job->lock )); + ifdef(osx, thread_mutex_lock( job->lock )); int ret = cook(userdata); // tcc: only a single running thread shall pass, because of racing shared state due to missing thread_local support at compiler level ifdef(tcc, thread_mutex_unlock( job->lock )); + ifdef(osx, thread_mutex_unlock( job->lock )); thread_exit( ret ); return ret; diff --git a/engine/split/v4k_cooker.c b/engine/split/v4k_cooker.c index 7f1e5a0..1bf843e 100644 --- a/engine/split/v4k_cooker.c +++ b/engine/split/v4k_cooker.c @@ -581,11 +581,13 @@ int cook_async( void *userdata ) { // tcc: only a single running thread shall pass, because of racing shared state due to missing thread_local support at compiler level ifdef(tcc, thread_mutex_lock( job->lock )); + ifdef(osx, thread_mutex_lock( job->lock )); int ret = cook(userdata); // tcc: only a single running thread shall pass, because of racing shared state due to missing thread_local support at compiler level ifdef(tcc, thread_mutex_unlock( job->lock )); + ifdef(osx, thread_mutex_unlock( job->lock )); thread_exit( ret ); return ret; diff --git a/engine/v4k.c b/engine/v4k.c index 27d2ff1..6fa9995 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -4393,11 +4393,13 @@ int cook_async( void *userdata ) { // tcc: only a single running thread shall pass, because of racing shared state due to missing thread_local support at compiler level ifdef(tcc, thread_mutex_lock( job->lock )); + ifdef(osx, thread_mutex_lock( job->lock )); int ret = cook(userdata); // tcc: only a single running thread shall pass, because of racing shared state due to missing thread_local support at compiler level ifdef(tcc, thread_mutex_unlock( job->lock )); + ifdef(osx, thread_mutex_unlock( job->lock )); thread_exit( ret ); return ret;