rust/library/std
Urgau 66dc09f3da
Rollup merge of #131746 - slanterns:once_box_order, r=joboet
Relax a memory order in `once_box`

per https://github.com/rust-lang/rust/pull/131094#discussion_r1788536445.

In the successful path we don't need `Acquire` since we don't care if the store in `f()` happened in other threads has become visible to the current thread. We'll use our own results instead and just using `Release` to ensure other threads can see our store to `Box` when they fail the `compare_exchange` will suffice.

Also took https://marabos.nl/atomics/memory-ordering.html#example-lazy-initialization-with-indirection as a reference.

`@rustbot` label: +T-libs

r? `@ibraheemdev`
2024-10-16 12:03:42 +02:00
..
benches Reformat use declarations. 2024-07-29 08:26:52 +10:00
src Rollup merge of #131746 - slanterns:once_box_order, r=joboet 2024-10-16 12:03:42 +02:00
tests rustc_target: Add sme-b16b16 as an explicit aarch64 target feature 2024-10-10 10:24:57 +00:00
build.rs enable f16 and f128 on windows-gnullvm targets 2024-10-05 23:55:39 +02:00
Cargo.toml Rollup merge of #128967 - devnexen:get_path_fbsd_upd, r=joboet 2024-10-14 06:04:26 +02:00