summary refs log tree commit diff
path: root/library/std/src/sys/sync/rwlock
AgeCommit message (Collapse)AuthorLines
2024-10-05Rollup merge of #131094 - joboet:lazy_once_box, r=ibraheemdevMatthias Krüger-4/+4
std: replace `LazyBox` with `OnceBox` 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-10-02std: make `thread::current` available in all `thread_local!` destructorsjoboet-2/+4
2024-10-01std: replace `LazyBox` with `OnceBox`joboet-4/+4
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-2/+2
2024-07-29Reformat `use` declarations.Nicholas Nethercote-15/+7
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-26Fix doc nitsJohn Arundel-3/+3
Many tiny changes to stdlib doc comments to make them consistent (for example "Returns foo", rather than "Return foo", per RFC1574), adding missing periods, paragraph breaks, backticks for monospace style, and other minor nits. https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text
2024-07-19kmc-solid: forbid(unsafe_op_in_unsafe_fn)Jubilee Young-0/+1
2024-06-20Add blank lines after module-level `//!` comments.Nicholas Nethercote-0/+1
Most modules have such a blank line, but some don't. Inserting the blank line makes it clearer that the `//!` comments are describing the entire module, rather than the `use` declaration(s) that immediately follows.
2024-04-16Rollup merge of #123811 - joboet:queue_em_up, r=ChrisDentonGuillaume Gomez-364/+6
Use queue-based `RwLock` on more platforms This switches over Windows 7, SGX and Xous to the queue-based `RwLock` implementation added in #110211, thereby fixing #121949 for Windows 7 and partially resolving #114581 on SGX. TEEOS can't currently be switched because it doesn't have a good thread parking implementation. CC `@roblabla` `@raoulstrackx` `@xobs` Could you help me test this, please? r? `@ChrisDenton` the Windows stuff should be familiar to you
2024-04-13Add missing `unsafe` to internal `std::thread::Thread` creation functionsbeetrees-1/+1
2024-04-11std: use queue-based `RwLock` on Windows 7joboet-50/+6
2024-04-11std: use queue-based `RwLock` on Xousjoboet-74/+0
2024-04-11std: use queue-based `RwLock` on SGXjoboet-240/+0
2024-03-31std: move `thread::current` TLS variable out of `thread_info`joboet-4/+2
2024-03-12std: move `Once` implementations to `sys`joboet-0/+1470