diff options
Diffstat (limited to 'lib/std/Thread/Condition.zig')
| -rw-r--r-- | lib/std/Thread/Condition.zig | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/std/Thread/Condition.zig b/lib/std/Thread/Condition.zig index ab75a0e5e2..793779dbdb 100644 --- a/lib/std/Thread/Condition.zig +++ b/lib/std/Thread/Condition.zig @@ -341,7 +341,7 @@ test "Condition - wait and signal" { }; var multi_wait = MultiWait{}; - for (multi_wait.threads) |*t| { + for (&multi_wait.threads) |*t| { t.* = try std.Thread.spawn(.{}, MultiWait.run, .{&multi_wait}); } @@ -389,7 +389,7 @@ test "Condition - signal" { }; var signal_test = SignalTest{}; - for (signal_test.threads) |*t| { + for (&signal_test.threads) |*t| { t.* = try std.Thread.spawn(.{}, SignalTest.run, .{&signal_test}); } @@ -457,7 +457,7 @@ test "Condition - multi signal" { var threads = [_]std.Thread{undefined} ** num_threads; // Create a circle of paddles which hit each other - for (threads) |*t, i| { + for (&threads, 0..) |*t, i| { const paddle = &paddles[i]; const hit_to = &paddles[(i + 1) % paddles.len]; t.* = try std.Thread.spawn(.{}, Paddle.run, .{ paddle, hit_to }); @@ -468,7 +468,7 @@ test "Condition - multi signal" { for (threads) |t| t.join(); // The first paddle will be hit one last time by the last paddle. - for (paddles) |p, i| { + for (paddles, 0..) |p, i| { const expected = @as(u32, num_iterations) + @boolToInt(i == 0); try testing.expectEqual(p.value, expected); } @@ -513,7 +513,7 @@ test "Condition - broadcasting" { }; var broadcast_test = BroadcastTest{}; - for (broadcast_test.threads) |*t| { + for (&broadcast_test.threads) |*t| { t.* = try std.Thread.spawn(.{}, BroadcastTest.run, .{&broadcast_test}); } @@ -584,7 +584,7 @@ test "Condition - broadcasting - wake all threads" { var broadcast_test = BroadcastTest{}; var thread_id: usize = 1; - for (broadcast_test.threads) |*t| { + for (&broadcast_test.threads) |*t| { t.* = try std.Thread.spawn(.{}, BroadcastTest.run, .{ &broadcast_test, thread_id }); thread_id += 1; } |
