We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
once_box
1 parent f79fae3 commit bbe5ddeCopy full SHA for bbe5dde
library/std/src/sys/sync/once_box.rs
@@ -60,7 +60,7 @@ impl<T> OnceBox<T> {
60
#[cold]
61
fn initialize(&self, f: impl FnOnce() -> Box<T>) -> &T {
62
let new_ptr = Box::into_raw(f());
63
- match self.ptr.compare_exchange(null_mut(), new_ptr, AcqRel, Acquire) {
+ match self.ptr.compare_exchange(null_mut(), new_ptr, Release, Acquire) {
64
Ok(_) => unsafe { &*new_ptr },
65
Err(ptr) => {
66
// Lost the race to another thread.
0 commit comments