diff --git a/Core/src/ThreadPThread.cpp b/Core/src/ThreadPThread.cpp index 1569922..2564ab6 100644 --- a/Core/src/ThreadPThread.cpp +++ b/Core/src/ThreadPThread.cpp @@ -8,6 +8,10 @@ #include #include +#ifdef __APPLE__ +#include +#endif + static void ReportErrorAndExit(int err, const char *msg) { char errMsg[1024]; sprintf(errMsg, "Thread error -- %s: ", msg); @@ -77,7 +81,11 @@ void TCThread::Join() { } void TCThread::Yield() { +#ifdef __APPLE__ + int result = sched_yield(); +#else int result = pthread_yield(); +#endif if(result != 0) { ReportErrorAndExit(result, "pthread_yield"); }