diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-02-18 09:02:57 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-02-18 19:17:21 -0700 |
| commit | aeaef8c0ffadab4145fd002f2edd87a6db66ebd1 (patch) | |
| tree | e4c76c76173e5e72bc1947e1886662c4c6b2ba3c /lib/std/Thread/Futex.zig | |
| parent | f0530385b57218ef323747bdb7438330a07d25cc (diff) | |
| download | zig-aeaef8c0ffadab4145fd002f2edd87a6db66ebd1.tar.gz zig-aeaef8c0ffadab4145fd002f2edd87a6db66ebd1.zip | |
update std lib and compiler sources to new for loop syntax
Diffstat (limited to 'lib/std/Thread/Futex.zig')
| -rw-r--r-- | lib/std/Thread/Futex.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/std/Thread/Futex.zig b/lib/std/Thread/Futex.zig index 15ef35698e..7efdc69d3b 100644 --- a/lib/std/Thread/Futex.zig +++ b/lib/std/Thread/Futex.zig @@ -895,7 +895,7 @@ test "Futex - signaling" { 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 }); @@ -950,14 +950,14 @@ test "Futex - broadcasting" { threads: [num_threads]std.Thread = undefined, fn run(self: *@This()) !void { - for (self.barriers) |*barrier| { + for (&self.barriers) |*barrier| { try barrier.wait(); } } }; var broadcast = Broadcast{}; - for (broadcast.threads) |*t| t.* = try std.Thread.spawn(.{}, Broadcast.run, .{&broadcast}); + for (&broadcast.threads) |*t| t.* = try std.Thread.spawn(.{}, Broadcast.run, .{&broadcast}); for (broadcast.threads) |t| t.join(); } |
