about summary refs log tree commit diff
path: root/library/std/src/sys/sync/rwlock/queue.rs
AgeCommit message (Collapse)AuthorLines
2025-04-27use generic Atomic type where possibleChristopher Durham-4/+4
in core/alloc/std only for now, and ignoring test files Co-authored-by: Pavel Grigorenko <GrigorenkoPV@ya.ru>
2024-11-18std: allow after-main use of synchronization primitivesjoboet-4/+2
By creating an unnamed thread handle when the actual one has already been destroyed, synchronization primitives using thread parking can be used even outside the Rust runtime. This also fixes an inefficiency in the queue-based `RwLock`: if `thread::current` was not initialized yet, it will create a new handle on every parking attempt without initializing `thread::current`. The private `current_or_unnamed` function introduced here fixes this.
2024-11-16fix `DOWNGRADED` bit unpreservedConnor Tsui-2/+2
Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
2024-11-16add safety comments for queue implementationConnor Tsui-13/+25
2024-11-16add `downgrade` to `queue` implementationConnor Tsui-70/+206
This commit adds the `downgrade` method onto the inner `RwLock` queue implementation. There are also a few other style patches included in this commit. Co-authored-by: Jonas Böttiger <jonasboettiger@icloud.com>
2024-11-16modify queue implementation documentationConnor Tsui-191/+214
This commit only has documentation changes and a few things moved around the file. The very few code changes are cosmetic: changes like turning a `match` statement into an `if let` statement or reducing indentation for long if statements. This commit also adds several safety comments on top of `unsafe` blocks that might not be immediately obvious to a first-time reader. Code "changes" are in: - `add_backlinks_and_find_tail` - `lock_contended` A majority of the changes are just expanding the comments from 80 columns to 100 columns.
2024-10-25library: consistently use American spelling for 'behavior'Ralf Jung-1/+1
2024-10-02std: make `thread::current` available in all `thread_local!` destructorsjoboet-2/+4
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-1/+1
2024-07-29Reformat `use` declarations.Nicholas Nethercote-4/+2
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-1/+1
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-04-13Add missing `unsafe` to internal `std::thread::Thread` creation functionsbeetrees-1/+1
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/+557