]> git.lizzy.rs Git - rust.git/commitdiff
make atomic intrinsic impl details private
authorRalf Jung <post@ralfj.de>
Mon, 18 Jul 2022 12:22:27 +0000 (08:22 -0400)
committerRalf Jung <post@ralfj.de>
Mon, 18 Jul 2022 12:22:27 +0000 (08:22 -0400)
src/lib.rs
src/shims/intrinsics/mod.rs
src/shims/unix/linux/sync.rs

index 80281d37de9a55b7ba2f3988ded1dc56c8b7d9e2..b3d408a6dc07244945073a84014a923dd2d350e4 100644 (file)
@@ -62,7 +62,6 @@
 pub use crate::shims::dlsym::{Dlsym, EvalContextExt as _};
 pub use crate::shims::env::{EnvVars, EvalContextExt as _};
 pub use crate::shims::foreign_items::EvalContextExt as _;
-pub use crate::shims::intrinsics::atomic::EvalContextExt as _;
 pub use crate::shims::intrinsics::EvalContextExt as _;
 pub use crate::shims::os_str::EvalContextExt as _;
 pub use crate::shims::panic::{CatchUnwindData, EvalContextExt as _};
index a8b8b807bd8282f0ffaf3267521c1ef696440a2f..9ffa40f3335353d06dfdc9e5138adaa598dbc090 100644 (file)
@@ -1,4 +1,4 @@
-pub mod atomic;
+mod atomic;
 mod simd;
 
 use std::iter;
@@ -11,6 +11,7 @@
 use rustc_target::abi::Integer;
 
 use crate::*;
+use atomic::EvalContextExt as _;
 use helpers::check_arg_count;
 use simd::EvalContextExt as _;
 
index a0e35c730c3d6ead7e70da6b492be7efe422fe89..a81fdb5e9988896f0b32b0ee2a18a8c820ab26c5 100644 (file)
@@ -169,7 +169,7 @@ pub fn futex<'tcx>(
             //
             // Thankfully, preemptions cannot happen inside a Miri shim, so we do not need to
             // do anything special to guarantee fence-load-comparison atomicity.
-            this.atomic_fence(&[], AtomicFenceOrd::SeqCst)?;
+            this.validate_atomic_fence(AtomicFenceOrd::SeqCst)?;
             // Read an `i32` through the pointer, regardless of any wrapper types.
             // It's not uncommon for `addr` to be passed as another type than `*mut i32`, such as `*const AtomicI32`.
             let futex_val = this
@@ -240,7 +240,7 @@ pub fn futex<'tcx>(
             // Together with the SeqCst fence in futex_wait, this makes sure that futex_wait
             // will see the latest value on addr which could be changed by our caller
             // before doing the syscall.
-            this.atomic_fence(&[], AtomicFenceOrd::SeqCst)?;
+            this.validate_atomic_fence(AtomicFenceOrd::SeqCst)?;
             let mut n = 0;
             for _ in 0..val {
                 if let Some(thread) = this.futex_wake(addr_usize, bitset) {