Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#131746 - slanterns:once_box_order, r=joboet
Relax a memory order in `once_box` per rust-lang#131094 (comment). 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`
- Loading branch information