diff options
| author | kprotty <kbutcher6200@gmail.com> | 2021-06-25 14:04:11 -0500 |
|---|---|---|
| committer | kprotty <kbutcher6200@gmail.com> | 2021-06-30 21:49:00 -0500 |
| commit | 18bcb2e990853f3e32cb0d72beb962390c9e8714 (patch) | |
| tree | 7913ee3d1e68ffc954fbca081cd5b2b6ab0db547 /lib/std/Thread/Futex.zig | |
| parent | 6a903fc4c0ebe67f953feef253cbdfd43893a1bd (diff) | |
| download | zig-18bcb2e990853f3e32cb0d72beb962390c9e8714.tar.gz zig-18bcb2e990853f3e32cb0d72beb962390c9e8714.zip | |
std.Thread: fix futex thread spawning
Diffstat (limited to 'lib/std/Thread/Futex.zig')
| -rw-r--r-- | lib/std/Thread/Futex.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/Thread/Futex.zig b/lib/std/Thread/Futex.zig index 033ecf688d..26ebe23364 100644 --- a/lib/std/Thread/Futex.zig +++ b/lib/std/Thread/Futex.zig @@ -418,8 +418,8 @@ test "Futex - Signal" { fn runThread(rx: *Self, tx: *Self) void { var iterations: u32 = start_value; while (iterations < 10) : (iterations += 1) { - self.rx.recv(iterations); - self.tx.send(iterations); + rx.recv(iterations); + tx.send(iterations); } } @@ -528,11 +528,11 @@ test "Futex - Chain" { const Self = @This(); fn runThread(self: *Self, index: usize) void { - const this_signal = &chain.self.threads[chain.index].signal; + const this_signal = &self.threads[index].signal; - var next_signal = &chain.self.completed; - if (chain.index + 1 < chain.self.threads.len) { - next_signal = &chain.self.threads[chain.index + 1].signal; + var next_signal = &self.completed; + if (index + 1 < self.threads.len) { + next_signal = &self.threads[index + 1].signal; } this_signal.wait(); |
