Yields the current thread potentially allowing other threads to run.
pub fn yield() YieldError!void
pub fn yield() YieldError!void {
if (native_os == .windows) switch (windows.ntdll.NtYieldExecution()) {
.SUCCESS, .NO_YIELD_PERFORMED => return,
else => return error.SystemCannotYield,
};
switch (posix.errno(posix.system.sched_yield())) {
.SUCCESS => return,
.NOSYS => return error.SystemCannotYield,
else => return error.SystemCannotYield,
}
}