Skip to content

Commit

Permalink
Do not provide AtomicCell when cfg(crossbeam_loom) is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 9, 2022
1 parent bd83e1f commit 85eac6a
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 227 deletions.
14 changes: 1 addition & 13 deletions crossbeam-epoch/src/lib.rs
Expand Up @@ -78,19 +78,7 @@ mod primitive {
pub(crate) mod sync {
pub(crate) mod atomic {
use core::sync::atomic::Ordering;
pub(crate) use loom::sync::atomic::AtomicUsize;
pub(crate) fn fence(ord: Ordering) {
if let Ordering::Acquire = ord {
} else {
// FIXME: loom only supports acquire fences at the moment.
// https://github.com/tokio-rs/loom/issues/117
// let's at least not panic...
// this may generate some false positives (`SeqCst` is stronger than `Acquire`
// for example), and some false negatives (`Relaxed` is weaker than `Acquire`),
// but it's the best we can do for the time being.
}
loom::sync::atomic::fence(Ordering::Acquire)
}
pub(crate) use loom::sync::atomic::{fence, AtomicUsize};

// FIXME: loom does not support compiler_fence at the moment.
// https://github.com/tokio-rs/loom/issues/117
Expand Down

0 comments on commit 85eac6a

Please sign in to comment.