y_octo/
sync.rs

1#[cfg(not(loom))]
2pub(crate) use std::sync::{
3    atomic::{AtomicBool, AtomicU32, AtomicU8, Ordering},
4    Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard,
5};
6pub use std::sync::{Arc, Weak};
7#[cfg(all(test, not(loom)))]
8pub(crate) use std::{
9    sync::{atomic::AtomicUsize, MutexGuard},
10    thread,
11};
12
13#[cfg(loom)]
14pub(crate) use loom::{
15    sync::{
16        atomic::{AtomicBool, AtomicU32, AtomicU8, AtomicUsize, Ordering},
17        Mutex, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard,
18    },
19    thread,
20};
21
22#[macro_export(local_inner_macros)]
23macro_rules! loom_model {
24    ($test:block) => {
25        #[cfg(loom)]
26        loom::model(move || $test);
27
28        #[cfg(not(loom))]
29        $test
30    };
31}