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/RwLock.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/std/Thread/RwLock.zig') diff --git a/lib/std/Thread/RwLock.zig b/lib/std/Thread/RwLock.zig index e77db10abb..a05d68df88 100644 --- a/lib/std/Thread/RwLock.zig +++ b/lib/std/Thread/RwLock.zig @@ -307,7 +307,7 @@ test "RwLock - concurrent access" { rwl: RwLock = .{}, writes: usize = 0, - reads: std.atomic.Atomic(usize) = std.atomic.Atomic(usize).init(0), + reads: std.atomic.Value(usize) = std.atomic.Value(usize).init(0), term1: usize = 0, term2: usize = 0, -- cgit v1.2.3