From 575c86551e7f4ccc8ec5389a21f669b5b5864eb4 Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Mon, 4 Jul 2022 07:53:33 +0200 Subject: Added a workaround if pthread_cond_clockwait is not supported (for #342) --- src/libtools/threads.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libtools/threads.c') diff --git a/src/libtools/threads.c b/src/libtools/threads.c index 8486d3dd..fb393a59 100755 --- a/src/libtools/threads.c +++ b/src/libtools/threads.c @@ -33,8 +33,10 @@ //void _pthread_cleanup_pop_restore(void* buffer, int exec); typedef void (*vFppp_t)(void*, void*, void*); typedef void (*vFpi_t)(void*, int); +typedef int (*iFppip_t)(void*, void*, int, void*); static vFppp_t real_pthread_cleanup_push_defer = NULL; static vFpi_t real_pthread_cleanup_pop_restore = NULL; +static iFppip_t real_pthread_cond_clockwait = NULL; void _pthread_cleanup_push(void* buffer, void* routine, void* arg); // declare hidden functions void _pthread_cleanup_pop(void* buffer, int exec); @@ -1150,6 +1152,7 @@ void init_pthread_helper() { real_pthread_cleanup_push_defer = (vFppp_t)dlsym(NULL, "_pthread_cleanup_push_defer"); real_pthread_cleanup_pop_restore = (vFpi_t)dlsym(NULL, "_pthread_cleanup_pop_restore"); + real_pthread_cond_clockwait = (iFppip_t)dlsym(NULL, "pthread_cond_clockwait"); InitCancelThread(); pthread_key_create(&jmpbuf_key, emujmpbuf_destroy); -- cgit 1.4.1