| ... | @@ -15,7 +15,6 @@ | ... | @@ -15,7 +15,6 @@ |
| 15 | | 15 | |
| 16 | const std = @import("../std.zig"); | 16 | const std = @import("../std.zig"); |
| 17 | const StaticResetEvent = @This(); | 17 | const StaticResetEvent = @This(); |
| 18 | const SpinLock = std.SpinLock; | | |
| 19 | const assert = std.debug.assert; | 18 | const assert = std.debug.assert; |
| 20 | const os = std.os; | 19 | const os = std.os; |
| 21 | const time = std.time; | 20 | const time = std.time; |
| ... | @@ -183,7 +182,7 @@ pub const AtomicEvent = struct { | ... | @@ -183,7 +182,7 @@ pub const AtomicEvent = struct { |
| 183 | timer = time.Timer.start() catch return error.TimedOut; | 182 | timer = time.Timer.start() catch return error.TimedOut; |
| 184 | | 183 | |
| 185 | while (@atomicLoad(u32, waiters, .Acquire) != WAKE) { | 184 | while (@atomicLoad(u32, waiters, .Acquire) != WAKE) { |
| 186 | SpinLock.yield(); | 185 | std.os.sched_yield() catch std.Thread.spinLoopHint(); |
| 187 | if (timeout) |timeout_ns| { | 186 | if (timeout) |timeout_ns| { |
| 188 | if (timer.read() >= timeout_ns) | 187 | if (timer.read() >= timeout_ns) |
| 189 | return error.TimedOut; | 188 | return error.TimedOut; |
| ... | @@ -294,7 +293,7 @@ pub const AtomicEvent = struct { | ... | @@ -294,7 +293,7 @@ pub const AtomicEvent = struct { |
| 294 | return @intToPtr(?windows.HANDLE, handle); | 293 | return @intToPtr(?windows.HANDLE, handle); |
| 295 | }, | 294 | }, |
| 296 | LOADING => { | 295 | LOADING => { |
| 297 | SpinLock.yield(); | 296 | std.os.sched_yield() catch std.Thread.spinLoopHint(); |
| 298 | handle = @atomicLoad(usize, &event_handle, .Monotonic); | 297 | handle = @atomicLoad(usize, &event_handle, .Monotonic); |
| 299 | }, | 298 | }, |
| 300 | else => { | 299 | else => { |