From f9a8fa385424ed119f3a3287b834572b9e9cc313 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 4 Jul 2022 07:58:09 +0200 Subject: Added a workaround if pthread_cond_clockwait is not supported (for #342) --- src/libtools/threads.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/libtools') diff --git a/src/libtools/threads.c b/src/libtools/threads.c index fb393a59..c62a1dcb 100755 --- a/src/libtools/threads.c +++ b/src/libtools/threads.c @@ -677,7 +677,12 @@ EXPORT int my_pthread_cond_wait(x64emu_t* emu, pthread_cond_t* cond, void* mutex EXPORT int my_pthread_cond_clockwait(x64emu_t *emu, pthread_cond_t* cond, void* mutex, __clockid_t __clock_id, const struct timespec* __abstime) { (void)emu; - return pthread_cond_clockwait(cond, getAlignedMutex((pthread_mutex_t*)mutex), __clock_id, __abstime); + if(real_pthread_cond_clockwait) + return real_pthread_cond_clockwait(cond, getAlignedMutex((pthread_mutex_t*)mutex), __clock_id, __abstime); + else { + errno = EINVAL; + return -1; + } } EXPORT void my__pthread_cleanup_push_defer(x64emu_t* emu, void* buffer, void* routine, void* arg) -- cgit 1.4.1