aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Thread
diff options
context:
space:
mode:
authorDavid John <dave@qword.space>2022-02-25 16:52:25 +0530
committerAndrew Kelley <andrew@ziglang.org>2022-02-27 15:34:02 -0500
commit139b731d82d0b851c8fb2e6dbb48b735e63eecd1 (patch)
tree93af126a3973c52c6b4fd039da8940f1d859a8b8 /lib/std/Thread
parent104a8840dbc0a09ce5e0035470052354a98693f1 (diff)
downloadzig-139b731d82d0b851c8fb2e6dbb48b735e63eecd1.tar.gz
zig-139b731d82d0b851c8fb2e6dbb48b735e63eecd1.zip
std: rename `sched_yield` to `yield` and move it to `std.Thread`
Diffstat (limited to 'lib/std/Thread')
-rw-r--r--lib/std/Thread/StaticResetEvent.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/Thread/StaticResetEvent.zig b/lib/std/Thread/StaticResetEvent.zig
index 80789cefec..fcd13f6ac7 100644
--- a/lib/std/Thread/StaticResetEvent.zig
+++ b/lib/std/Thread/StaticResetEvent.zig
@@ -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 => {