aboutsummaryrefslogtreecommitdiff
path: root/lib/std/event/wait_group.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-01-14 20:41:37 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-01-14 20:41:37 -0700
commita9667b5a859a589056f23df2b74b91fede0bbbfa (patch)
tree0efb150c8b3357b61f2dc11b0018a1038fe6d354 /lib/std/event/wait_group.zig
parent2b0e3ee228e01473cf880f719db9bde5b8f34d25 (diff)
downloadzig-a9667b5a859a589056f23df2b74b91fede0bbbfa.tar.gz
zig-a9667b5a859a589056f23df2b74b91fede0bbbfa.zip
organize std lib concurrency primitives and add RwLock
* move concurrency primitives that always operate on kernel threads to the std.Thread namespace * remove std.SpinLock. Nobody should use this in a non-freestanding environment; the other primitives are always preferable. In freestanding, it will be necessary to put custom spin logic in there, so there are no use cases for a std lib version. * move some std lib files to the top level fields convention * add std.Thread.spinLoopHint * add std.Thread.Condition * add std.Thread.Semaphore * new implementation of std.Thread.Mutex for Windows and non-pthreads Linux * add std.Thread.RwLock Implementations provided by @kprotty
Diffstat (limited to 'lib/std/event/wait_group.zig')
-rw-r--r--lib/std/event/wait_group.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/std/event/wait_group.zig b/lib/std/event/wait_group.zig
index d123f7df27..0b83c18c74 100644
--- a/lib/std/event/wait_group.zig
+++ b/lib/std/event/wait_group.zig
@@ -30,7 +30,7 @@ pub fn WaitGroupGeneric(comptime counter_size: u16) type {
return struct {
counter: CounterType = 0,
max_counter: CounterType = std.math.maxInt(CounterType),
- mutex: std.Mutex = .{},
+ mutex: std.Thread.Mutex = .{},
waiters: ?*Waiter = null,
const Waiter = struct {
next: ?*Waiter,