# organize std lib concurrency primitives and add RwLock · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/a9667b5a859a589056f23df2b74b91fede0bbbfa)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: a9667b5a859a589056f23df2b74b91fede0bbbfa

Requested commit: a9667b5a859a589056f23df2b74b91fede0bbbfa

Commit: a9667b5a859a589056f23df2b74b91fede0bbbfa

Tree: 0efb150c8b3357b61f2dc11b0018a1038fe6d354

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
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

```

## Parents

- [2b0e3ee228e01473cf880f719db9bde5b8f34d25](https://git.cafe/gitcafe/zig/commit/2b0e3ee228e01473cf880f719db9bde5b8f34d25?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/a9667b5a859a589056f23df2b74b91fede0bbbfa?format=markdown)
