From 70931dbdea96d92feb60406c827e39e566317863 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 22 Nov 2023 18:49:18 -0700 Subject: rework std.atomic * move std.atomic.Atomic to std.atomic.Value * fix incorrect argument order passed to testing.expectEqual * make the functions be a thin wrapper over the atomic builtins and stick to the naming conventions. * remove pointless functions loadUnchecked and storeUnchecked. Instead, name the field `raw` instead of `value` (which is redundant with the type name). * simplify the tests by not passing every possible combination. Many cases were iterating over every possible combinations but then not even using the for loop element value! * remove the redundant compile errors which are already implemented by the language itself. * remove dead x86 inline assembly. this should be implemented in the language if at all. --- lib/std/Thread/WaitGroup.zig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/std/Thread/WaitGroup.zig') diff --git a/lib/std/Thread/WaitGroup.zig b/lib/std/Thread/WaitGroup.zig index f2274db86a..a6a82a9492 100644 --- a/lib/std/Thread/WaitGroup.zig +++ b/lib/std/Thread/WaitGroup.zig @@ -1,12 +1,11 @@ const std = @import("std"); -const Atomic = std.atomic.Atomic; const assert = std.debug.assert; const WaitGroup = @This(); const is_waiting: usize = 1 << 0; const one_pending: usize = 1 << 1; -state: Atomic(usize) = Atomic(usize).init(0), +state: std.atomic.Value(usize) = std.atomic.Value(usize).init(0), event: std.Thread.ResetEvent = .{}, pub fn start(self: *WaitGroup) void { -- cgit v1.2.3