std.sync.atomic: extended atomic helper functions (#8866)

- deprecates `std.Thread.spinLoopHint` and moves it to `std.atomic.spinLoopHint`
- added an Atomic(T) generic wrapper type which replaces atomic.Bool and atomic.Int
- in Atomic(T), selectively expose member functions depending on T and include bitwise atomic methods when T is an Integer
- added fence() and compilerFence() to std.atomic
This commit is contained in:
protty
2021-05-31 11:11:30 -05:00
committed by GitHub
parent 57cf9f7ea6
commit eb6975f088
14 changed files with 624 additions and 193 deletions

View File

@@ -2111,7 +2111,10 @@ test "parse into struct with duplicate field" {
const ballast = try testing.allocator.alloc(u64, 1);
defer testing.allocator.free(ballast);
const options_first = ParseOptions{ .allocator = testing.allocator, .duplicate_field_behavior = .UseFirst };
const options_first = ParseOptions{
.allocator = testing.allocator,
.duplicate_field_behavior = .UseFirst,
};
const options_last = ParseOptions{
.allocator = testing.allocator,