about summary refs log tree commit diff
path: root/library/std/src/sys/sync/condvar/pthread.rs
AgeCommit message (Collapse)AuthorLines
2025-04-27use generic Atomic type where possibleChristopher Durham-2/+2
in core/alloc/std only for now, and ignoring test files Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
2024-11-30std: clarify comments about initializationjoboet-1/+1
2024-10-28std: refactor `pthread`-based synchronizationjoboet-159/+51
The non-trivial code for `pthread_condvar` is duplicated across the thread parking and the `Mutex`/`Condvar` implementations. This PR moves that code into `sys::pal`, which now exposes a non-movable wrapper type for `pthread_mutex_t` and `pthread_condvar_t`.
2024-10-25library: consistently use American spelling for 'behavior'Ralf Jung-1/+1
2024-10-01std: replace `LazyBox` with `OnceBox`joboet-20/+18
This PR replaces the `LazyBox` wrapper used to allocate the pthread primitives with `OnceBox`, which has a more familiar API mirroring that of `OnceLock`. This cleans up the code in preparation for larger changes like #128184 (from which this PR was split) and allows some neat optimizations, like avoid an acquire-load of the allocation pointer in `Mutex::unlock`, where the initialization of the allocation must have already been observed. Additionally, I've gotten rid of the TEEOS `Condvar` code, it's just a duplicate of the pthread one anyway and I didn't want to repeat myself.
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+2
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-04-28Use `target_vendor = "apple"` instead of `target_os = "..."`Mads Marquart-18/+6
2024-03-18Support for visionOSAdam Gastineau-0/+3
2024-03-12std: move `Once` implementations to `sys`joboet-0/+206