mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-29 16:52:28 +00:00
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:
parent
34e39ad027
commit
a0ddb889da
2 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue