1#![no_std]
28#![doc(test(
29    no_crate_inject,
30    attr(
31        deny(warnings, rust_2018_idioms),
32        allow(dead_code, unused_assignments, unused_variables)
33    )
34))]
35#![warn(
36    missing_docs,
37    missing_debug_implementations,
38    rust_2018_idioms,
39    unreachable_pub
40)]
41
42#[cfg(feature = "std")]
43extern crate std;
44
45#[cfg(crossbeam_loom)]
46#[allow(unused_imports)]
47mod primitive {
48    pub(crate) mod hint {
49        pub(crate) use loom::hint::spin_loop;
50    }
51    pub(crate) mod sync {
52        pub(crate) mod atomic {
53            pub(crate) use loom::sync::atomic::{
54                AtomicBool, AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, AtomicU16,
55                AtomicU32, AtomicU64, AtomicU8, AtomicUsize, Ordering,
56            };
57
58            pub(crate) use loom::sync::atomic::fence as compiler_fence;
64        }
65        pub(crate) use loom::sync::{Arc, Condvar, Mutex};
66    }
67}
68#[cfg(not(crossbeam_loom))]
69#[allow(unused_imports)]
70mod primitive {
71    pub(crate) mod hint {
72        pub(crate) use core::hint::spin_loop;
73    }
74    pub(crate) mod sync {
75        pub(crate) mod atomic {
76            pub(crate) use core::sync::atomic::{compiler_fence, Ordering};
77            #[cfg(not(crossbeam_no_atomic))]
78            pub(crate) use core::sync::atomic::{
79                AtomicBool, AtomicI16, AtomicI8, AtomicIsize, AtomicU16, AtomicU8, AtomicUsize,
80            };
81            #[cfg(not(crossbeam_no_atomic))]
82            #[cfg(any(target_has_atomic = "32", not(target_pointer_width = "16")))]
83            pub(crate) use core::sync::atomic::{AtomicI32, AtomicU32};
84            #[cfg(not(crossbeam_no_atomic))]
85            #[cfg(any(
86                target_has_atomic = "64",
87                not(any(target_pointer_width = "16", target_pointer_width = "32")),
88            ))]
89            pub(crate) use core::sync::atomic::{AtomicI64, AtomicU64};
90        }
91
92        #[cfg(feature = "std")]
93        pub(crate) use std::sync::{Arc, Condvar, Mutex};
94    }
95}
96
97pub mod atomic;
98
99mod cache_padded;
100pub use crate::cache_padded::CachePadded;
101
102mod backoff;
103pub use crate::backoff::Backoff;
104
105#[cfg(feature = "std")]
106pub mod sync;
107
108#[cfg(feature = "std")]
109#[cfg(not(crossbeam_loom))]
110pub mod thread;