diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-08-14 16:51:58 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-08-14 16:51:58 +1000 |
commit | d7065e7611b4c00e4f33c62f4da2bb9cff7170bd (patch) | |
tree | bd38d243b7b3b72768fc73c2a10e9e973d21a584 /source/core/StarThread_unix.cpp | |
parent | 295ed51126bb350c76ac1db821610033d9ad0815 (diff) |
Update StarThread_unix.cpp
Diffstat (limited to 'source/core/StarThread_unix.cpp')
-rw-r--r-- | source/core/StarThread_unix.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/core/StarThread_unix.cpp b/source/core/StarThread_unix.cpp index 7d255f4..a87ee29 100644 --- a/source/core/StarThread_unix.cpp +++ b/source/core/StarThread_unix.cpp @@ -131,12 +131,16 @@ struct MutexImpl { } void lock() { +#ifndef STAR_SYSTEM_MACOS timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += 60; if (pthread_mutex_timedlock(&mutex, &ts) != 0) { Logger::warn("Mutex lock is taking too long, printing stack"); printStack("Mutex::lock"); +#else + { +#endif pthread_mutex_lock(&mutex); } } @@ -206,12 +210,16 @@ struct RecursiveMutexImpl { } void lock() { +#ifndef STAR_SYSTEM_MACOS timespec ts; clock_gettime(CLOCK_REALTIME, &ts); ts.tv_sec += 60; if (pthread_mutex_timedlock(&mutex, &ts) != 0) { Logger::warn("RecursiveMutex lock is taking too long, printing stack"); printStack("RecursiveMutex::lock"); +#else + { +#endif pthread_mutex_lock(&mutex); } } |