diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-07-04 07:58:09 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-07-04 07:58:09 +0200 |
| commit | f9a8fa385424ed119f3a3287b834572b9e9cc313 (patch) | |
| tree | 255da71c803f5ace16942041a28cda1aa0546297 /src/libtools | |
| parent | 575c86551e7f4ccc8ec5389a21f669b5b5864eb4 (diff) | |
| download | box64-f9a8fa385424ed119f3a3287b834572b9e9cc313.tar.gz box64-f9a8fa385424ed119f3a3287b834572b9e9cc313.zip | |
Added a workaround if pthread_cond_clockwait is not supported (for #342)
Diffstat (limited to 'src/libtools')
| -rwxr-xr-x | src/libtools/threads.c | 7 |
1 files changed, 6 insertions, 1 deletions
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) |