diff options
| author | Jacob G-W <jacoblevgw@gmail.com> | 2021-06-19 21:10:22 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-06-21 17:03:03 -0700 |
| commit | 9fffffb07b081858db0c2102a0680aa166b48263 (patch) | |
| tree | 36caed31c5b2aaa8e08bb8e6e90e9b2c30910ff3 /lib/std/Thread | |
| parent | b83b3883ba0b5e965f8f7f1298c77c6d766741af (diff) | |
| download | zig-9fffffb07b081858db0c2102a0680aa166b48263.tar.gz zig-9fffffb07b081858db0c2102a0680aa166b48263.zip | |
fix code broken from previous commit
Diffstat (limited to 'lib/std/Thread')
| -rw-r--r-- | lib/std/Thread/Condition.zig | 10 | ||||
| -rw-r--r-- | lib/std/Thread/StaticResetEvent.zig | 7 |
2 files changed, 14 insertions, 3 deletions
diff --git a/lib/std/Thread/Condition.zig b/lib/std/Thread/Condition.zig index d88a6de31e..8485f84aa4 100644 --- a/lib/std/Thread/Condition.zig +++ b/lib/std/Thread/Condition.zig @@ -40,12 +40,18 @@ else pub const SingleThreadedCondition = struct { pub fn wait(cond: *SingleThreadedCondition, mutex: *Mutex) void { + _ = cond; + _ = mutex; unreachable; // deadlock detected } - pub fn signal(cond: *SingleThreadedCondition) void {} + pub fn signal(cond: *SingleThreadedCondition) void { + _ = cond; + } - pub fn broadcast(cond: *SingleThreadedCondition) void {} + pub fn broadcast(cond: *SingleThreadedCondition) void { + _ = cond; + } }; pub const WindowsCondition = struct { diff --git a/lib/std/Thread/StaticResetEvent.zig b/lib/std/Thread/StaticResetEvent.zig index 0a6a1d568e..6f869e0d89 100644 --- a/lib/std/Thread/StaticResetEvent.zig +++ b/lib/std/Thread/StaticResetEvent.zig @@ -105,6 +105,7 @@ pub const DebugEvent = struct { } pub fn timedWait(ev: *DebugEvent, timeout: u64) TimedWaitResult { + _ = timeout; switch (ev.state) { .unset => return .timed_out, .set => return .event_set, @@ -174,7 +175,10 @@ pub const AtomicEvent = struct { }; pub const SpinFutex = struct { - fn wake(waiters: *u32, wake_count: u32) void {} + fn wake(waiters: *u32, wake_count: u32) void { + _ = waiters; + _ = wake_count; + } fn wait(waiters: *u32, timeout: ?u64) !void { var timer: time.Timer = undefined; @@ -193,6 +197,7 @@ pub const AtomicEvent = struct { pub const LinuxFutex = struct { fn wake(waiters: *u32, wake_count: u32) void { + _ = wake_count; const waiting = std.math.maxInt(i32); // wake_count const ptr = @ptrCast(*const i32, waiters); const rc = linux.futex_wake(ptr, linux.FUTEX_WAKE | linux.FUTEX_PRIVATE_FLAG, waiting); |
