Update StarThread_unix.cpp

This commit is contained in:
Kae 2024-09-15 16:41:41 +10:00
parent 304d32d5c0
commit 40299558dd

View File

@ -22,6 +22,10 @@
#define MAX_THREAD_NAMELEN 16
#endif
//#ifndef STAR_SYSTEM_MACOS
//#define STAR_MUTEX_TIMED
//#endif
namespace Star {
struct ThreadImpl {
@ -131,7 +135,7 @@ struct MutexImpl {
}
void lock() {
#ifndef STAR_SYSTEM_MACOS
#ifdef STAR_MUTEX_TIMED
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_sec += 60;
@ -210,7 +214,7 @@ struct RecursiveMutexImpl {
}
void lock() {
#ifndef STAR_SYSTEM_MACOS
#ifdef STAR_MUTEX_TIMED
timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_sec += 60;