about summary refs log tree commit diff stats
path: root/src/libtools
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2022-07-04 07:53:33 +0200
committerptitSeb <sebastien.chev@gmail.com>2022-07-04 07:53:33 +0200
commit575c86551e7f4ccc8ec5389a21f669b5b5864eb4 (patch)
tree8fbb065afd6c71275c5e1febfa0d723b9b34173c /src/libtools
parent57bbac49234fed3dcf61b1a5b076a552ae3b38cc (diff)
downloadbox64-575c86551e7f4ccc8ec5389a21f669b5b5864eb4.tar.gz
box64-575c86551e7f4ccc8ec5389a21f669b5b5864eb4.zip
Added a workaround if pthread_cond_clockwait is not supported (for #342)
Diffstat (limited to 'src/libtools')
-rwxr-xr-xsrc/libtools/threads.c3
1 files changed, 3 insertions, 0 deletions
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);