zig/lib/std/Thread
Felix Kollmann 8addf53fb5
Add timedWait to std.Thread.Semaphore (#18805)
* Add `timedWait` to `std.Thread.Semaphore`

Add example to documentation of `std.Thread.Semaphore`

* Add unit test for thread semaphore timed wait

Fix missing try

* Change unit test to be simpler

* Change `timedWait()` to keep a deadline

* Change `timedWait()` to return earlier in some scenarios

* Change `timedWait()` to keep a deadline (based on std.Timer)

(similar to std.Thread.Futex)

---------

Co-authored-by: protty <45520026+kprotty@users.noreply.github.com>
2024-02-13 11:51:42 -06:00
..
Condition.zig rework std.atomic 2023-11-22 19:08:55 -07:00
Futex.zig bsd: debitrot atomic and debug 2023-11-26 14:28:22 -05:00
Mutex.zig rework std.atomic 2023-11-22 19:08:55 -07:00
Pool.zig Free threads in std.Thread.Pool.init only with pool.join 2024-01-22 11:24:35 -08:00
ResetEvent.zig rework std.atomic 2023-11-22 19:08:55 -07:00
RwLock.zig Replace std.rand references with std.Random 2024-02-08 15:21:35 +01:00
Semaphore.zig Add timedWait to std.Thread.Semaphore (#18805) 2024-02-13 11:51:42 -06:00
WaitGroup.zig rework std.atomic 2023-11-22 19:08:55 -07:00