authorgravatar for kbutcher6200@gmail.comkprotty <kbutcher6200@gmail.com> 2021-06-25 14:04:11-05:00
committergravatar for kbutcher6200@gmail.comkprotty <kbutcher6200@gmail.com> 2021-06-30 21:49:00-05:00
log18bcb2e990853f3e32cb0d72beb962390c9e8714
tree7913ee3d1e68ffc954fbca081cd5b2b6ab0db547
parent6a903fc4c0ebe67f953feef253cbdfd43893a1bd

std.Thread: fix futex thread spawning


1 files changed, 6 insertions(+), 6 deletions(-)

lib/std/Thread/Futex.zig+6-6
...@@ -418,8 +418,8 @@ test "Futex - Signal" {...@@ -418,8 +418,8 @@ test "Futex - Signal" {
418 fn runThread(rx: *Self, tx: *Self) void {418 fn runThread(rx: *Self, tx: *Self) void {
419 var iterations: u32 = start_value;419 var iterations: u32 = start_value;
420 while (iterations < 10) : (iterations += 1) {420 while (iterations < 10) : (iterations += 1) {
421 self.rx.recv(iterations);421 rx.recv(iterations);
422 self.tx.send(iterations);422 tx.send(iterations);
423 }423 }
424 }424 }
425425
...@@ -528,11 +528,11 @@ test "Futex - Chain" {...@@ -528,11 +528,11 @@ test "Futex - Chain" {
528 const Self = @This();528 const Self = @This();
529529
530 fn runThread(self: *Self, index: usize) void {530 fn runThread(self: *Self, index: usize) void {
531 const this_signal = &chain.self.threads[chain.index].signal;531 const this_signal = &self.threads[index].signal;
532532
533 var next_signal = &chain.self.completed;533 var next_signal = &self.completed;
534 if (chain.index + 1 < chain.self.threads.len) {534 if (index + 1 < self.threads.len) {
535 next_signal = &chain.self.threads[chain.index + 1].signal;535 next_signal = &self.threads[index + 1].signal;
536 }536 }
537537
538 this_signal.wait();538 this_signal.wait();