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
This commit is contained in:
@@ -50,7 +50,7 @@ done: bool = true,
|
||||
/// Protects the `refresh` function, as well as `node.recently_updated_child`.
|
||||
/// Without this, callsites would call `Node.end` and then free `Node` memory
|
||||
/// while it was still being accessed by the `refresh` function.
|
||||
update_lock: std.Mutex = .{},
|
||||
update_lock: std.Thread.Mutex = .{},
|
||||
|
||||
/// Keeps track of how many columns in the terminal have been output, so that
|
||||
/// we can move the cursor back later.
|
||||
|
||||
Reference in New Issue
Block a user