Add feature to support platforms without atomic CAS (#467)

This commit is contained in:
Taiki Endo
2025-01-31 18:52:54 +09:00
committed by GitHub
parent 71824b095c
commit 16fd473d5c
7 changed files with 53 additions and 6 deletions
+3
View File
@@ -1,7 +1,10 @@
#[cfg(not(all(test, loom)))]
pub(crate) mod sync {
pub(crate) mod atomic {
#[cfg(not(feature = "extra-platforms"))]
pub(crate) use core::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
#[cfg(feature = "extra-platforms")]
pub(crate) use extra_platforms::{AtomicPtr, AtomicUsize, Ordering};
pub(crate) trait AtomicMut<T> {
fn with_mut<F, R>(&mut self, f: F) -> R