std: rename sched_yield to yield and move it to std.Thread
This commit is contained in:
committed by
Andrew Kelley
parent
104a8840db
commit
139b731d82
@@ -181,7 +181,7 @@ pub const AtomicEvent = struct {
|
||||
timer = time.Timer.start() catch return error.TimedOut;
|
||||
|
||||
while (@atomicLoad(u32, waiters, .Acquire) != WAKE) {
|
||||
std.os.sched_yield() catch std.atomic.spinLoopHint();
|
||||
std.Thread.yield() catch std.atomic.spinLoopHint();
|
||||
if (timeout) |timeout_ns| {
|
||||
if (timer.read() >= timeout_ns)
|
||||
return error.TimedOut;
|
||||
@@ -293,7 +293,7 @@ pub const AtomicEvent = struct {
|
||||
return @intToPtr(?windows.HANDLE, handle);
|
||||
},
|
||||
LOADING => {
|
||||
std.os.sched_yield() catch std.atomic.spinLoopHint();
|
||||
std.Thread.yield() catch std.atomic.spinLoopHint();
|
||||
handle = @atomicLoad(usize, &event_handle, .Monotonic);
|
||||
},
|
||||
else => {
|
||||
|
||||
Reference in New Issue
Block a user