about summary refs log tree commit diff
path: root/library/std/src/sys/sync
diff options
context:
space:
mode:
Diffstat (limited to 'library/std/src/sys/sync')
-rw-r--r--library/std/src/sys/sync/once_box.rs4
-rw-r--r--library/std/src/sys/sync/thread_parking/mod.rs1
2 files changed, 3 insertions, 2 deletions
diff --git a/library/std/src/sys/sync/once_box.rs b/library/std/src/sys/sync/once_box.rs
index 1422b5a1721..9d24db2245a 100644
--- a/library/std/src/sys/sync/once_box.rs
+++ b/library/std/src/sys/sync/once_box.rs
@@ -8,7 +8,7 @@
 use crate::mem::replace;
 use crate::ptr::null_mut;
 use crate::sync::atomic::AtomicPtr;
-use crate::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed};
+use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release};
 
 pub(crate) struct OnceBox<T> {
     ptr: AtomicPtr<T>,
@@ -60,7 +60,7 @@ impl<T> OnceBox<T> {
     #[cold]
     fn initialize(&self, f: impl FnOnce() -> Box<T>) -> &T {
         let new_ptr = Box::into_raw(f());
-        match self.ptr.compare_exchange(null_mut(), new_ptr, AcqRel, Acquire) {
+        match self.ptr.compare_exchange(null_mut(), new_ptr, Release, Acquire) {
             Ok(_) => unsafe { &*new_ptr },
             Err(ptr) => {
                 // Lost the race to another thread.
diff --git a/library/std/src/sys/sync/thread_parking/mod.rs b/library/std/src/sys/sync/thread_parking/mod.rs
index 0ebc5e093ee..f4d8fa0a58c 100644
--- a/library/std/src/sys/sync/thread_parking/mod.rs
+++ b/library/std/src/sys/sync/thread_parking/mod.rs
@@ -23,6 +23,7 @@ cfg_if::cfg_if! {
         mod windows7;
         pub use windows7::Parker;
     } else if #[cfg(all(target_vendor = "apple", not(miri)))] {
+        // Doesn't work in Miri, see <https://github.com/rust-lang/miri/issues/2589>.
         mod darwin;
         pub use darwin::Parker;
     } else if #[cfg(target_os = "xous")] {