diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-01-14 20:41:37 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-14 20:41:37 -0700 |
| commit | a9667b5a859a589056f23df2b74b91fede0bbbfa (patch) | |
| tree | 0efb150c8b3357b61f2dc11b0018a1038fe6d354 /lib/std/std.zig | |
| parent | 2b0e3ee228e01473cf880f719db9bde5b8f34d25 (diff) | |
| download | zig-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/std.zig')
| -rw-r--r-- | lib/std/std.zig | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/std/std.zig b/lib/std/std.zig index d736899a45..d085d4fc41 100644 --- a/lib/std/std.zig +++ b/lib/std/std.zig @@ -13,7 +13,6 @@ pub const AutoArrayHashMap = array_hash_map.AutoArrayHashMap; pub const AutoArrayHashMapUnmanaged = array_hash_map.AutoArrayHashMapUnmanaged; pub const AutoHashMap = hash_map.AutoHashMap; pub const AutoHashMapUnmanaged = hash_map.AutoHashMapUnmanaged; -pub const AutoResetEvent = @import("auto_reset_event.zig").AutoResetEvent; pub const BufMap = @import("buf_map.zig").BufMap; pub const BufSet = @import("buf_set.zig").BufSet; pub const ChildProcess = @import("child_process.zig").ChildProcess; @@ -21,26 +20,21 @@ pub const ComptimeStringMap = @import("comptime_string_map.zig").ComptimeStringM pub const DynLib = @import("dynamic_library.zig").DynLib; pub const HashMap = hash_map.HashMap; pub const HashMapUnmanaged = hash_map.HashMapUnmanaged; -pub const mutex = @import("mutex.zig"); -pub const Mutex = mutex.Mutex; pub const PackedIntArray = @import("packed_int_array.zig").PackedIntArray; pub const PackedIntArrayEndian = @import("packed_int_array.zig").PackedIntArrayEndian; pub const PackedIntSlice = @import("packed_int_array.zig").PackedIntSlice; pub const PackedIntSliceEndian = @import("packed_int_array.zig").PackedIntSliceEndian; pub const PriorityQueue = @import("priority_queue.zig").PriorityQueue; pub const Progress = @import("Progress.zig"); -pub const ResetEvent = @import("ResetEvent.zig"); pub const SemanticVersion = @import("SemanticVersion.zig"); pub const SinglyLinkedList = @import("linked_list.zig").SinglyLinkedList; -pub const SpinLock = @import("SpinLock.zig"); -pub const StaticResetEvent = @import("StaticResetEvent.zig"); pub const StringHashMap = hash_map.StringHashMap; pub const StringHashMapUnmanaged = hash_map.StringHashMapUnmanaged; pub const StringArrayHashMap = array_hash_map.StringArrayHashMap; pub const StringArrayHashMapUnmanaged = array_hash_map.StringArrayHashMapUnmanaged; pub const TailQueue = @import("linked_list.zig").TailQueue; pub const Target = @import("target.zig").Target; -pub const Thread = @import("thread.zig").Thread; +pub const Thread = @import("Thread.zig"); pub const array_hash_map = @import("array_hash_map.zig"); pub const atomic = @import("atomic.zig"); @@ -98,12 +92,7 @@ test "" { // server is hitting OOM. TODO revert this after stage2 arrives. _ = ChildProcess; _ = DynLib; - _ = mutex; - _ = Mutex; _ = Progress; - _ = ResetEvent; - _ = SpinLock; - _ = StaticResetEvent; _ = Target; _ = Thread; |
