Polyfill sched_yield() on XNU

We were using the Mach system call swtch() earlier. It's possible Apple
removed this system call in their recent 12.4 upgrade. We're better off
using x86 PAUSE here, since Mach is less public than the UNIX syscalls.

See #426
This commit is contained in:
Justine Tunney 2022-06-17 03:43:20 -07:00
parent 34e39ad027
commit a0ddb889da
2 changed files with 8 additions and 1 deletions

View file

@ -26,6 +26,13 @@
// @return 0 on success, or -1 w/ errno
sched_yield:
#if SupportsXnu()
testb IsXnu()
jz 1f
pause
ret
#endif
#if SupportsWindows()
// Windows Support
//