mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
66dc09f3da
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` |
||
---|---|---|
.. | ||
alloc | ||
backtrace@230570f2da | ||
core | ||
panic_abort | ||
panic_unwind | ||
portable-simd | ||
proc_macro | ||
profiler_builtins | ||
rtstartup | ||
rustc-std-workspace-alloc | ||
rustc-std-workspace-core | ||
rustc-std-workspace-std | ||
std | ||
stdarch@c881fe3231 | ||
sysroot | ||
test | ||
unwind | ||
windows_targets | ||
Cargo.lock | ||
Cargo.toml |