zig/lib/std/Thread
jumpnbrownweasel 71f8762959
Fix for #13163: DefaultRwLock accumulates write-waiters, eventually fails to write lock (#13180)
* Fix for: DefaultRwLock accumulates write-waiters, eventually fails to write lock #13163

* Comment out debug.print at the end of the last test.

* Code formatting

* - use equality test after lock/unlock rather than peeking into internals.
  however, this is still implementation specific and only done for
  DefaultRwLock.
- add num_reads maximum to ensure that reader threads stop if writer threads are
  starved
- use relaxed orderings for the read atomic counter
- don't check at the end for non-zero read ops, since the reader threads may
  only run once if they are starved

* More review changes
- Monotonic is sufficient for incrementing the reads counter
2022-10-17 18:15:15 -05:00
..
Condition.zig math: make cast return optional instead of an error 2022-05-27 16:43:33 -04:00
Futex.zig stage2+stage1: remove type parameter from bit builtins 2022-08-22 11:19:20 +03:00
Mutex.zig stage2+stage1: remove type parameter from bit builtins 2022-08-22 11:19:20 +03:00
ResetEvent.zig std.Thread: ResetEvent improvements (#11523) 2022-04-26 16:48:56 -05:00
RwLock.zig Fix for #13163: DefaultRwLock accumulates write-waiters, eventually fails to write lock (#13180) 2022-10-17 18:15:15 -05:00
Semaphore.zig std: add test for Thread.Semaphore 2022-01-29 20:30:53 +00:00