Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/core/StarThread_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/core/StarThread_unix.cpp')
-rw-r--r--source/core/StarThread_unix.cpp8
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);
}
}