mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2024-11-24 09:35:48 +01:00
On OS X, replace pthread_yield with sched_yield
This commit is contained in:
parent
d3f03a1fd3
commit
78ed5f5e92
@ -8,6 +8,10 @@
|
||||
#include <pthread.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <sched.h>
|
||||
#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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user