summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/src/sync/mod.rs')
-rw-r--r--tokio/src/sync/mod.rs55
1 files changed, 26 insertions, 29 deletions
diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs
index cf003816..40566c0c 100644
--- a/tokio/src/sync/mod.rs
+++ b/tokio/src/sync/mod.rs
@@ -13,43 +13,40 @@
//! - [watch](watch/index.html), a single-producer, multi-consumer channel that
//! only stores the **most recently** sent value.
-macro_rules! debug {
- ($($t:tt)*) => {
- if false {
- println!($($t)*);
- }
- }
-}
+cfg_sync! {
+ mod barrier;
+ pub use barrier::{Barrier, BarrierWaitResult};
-macro_rules! if_loom {
- ($($t:tt)*) => {{
- #[cfg(loom)]
- const LOOM: bool = true;
- #[cfg(not(loom))]
- const LOOM: bool = false;
-
- if LOOM {
- $($t)*
- }
- }}
-}
+ pub mod mpsc;
-mod barrier;
-pub use barrier::{Barrier, BarrierWaitResult};
+ mod mutex;
+ pub use mutex::{Mutex, MutexGuard};
-pub mod mpsc;
+ pub mod oneshot;
-mod mutex;
-pub use mutex::{Mutex, MutexGuard};
+ pub(crate) mod semaphore;
-pub mod oneshot;
+ mod task;
+ pub(crate) use task::AtomicWaker;
-pub mod semaphore;
+ pub mod watch;
+}
-mod task;
-pub(crate) use task::AtomicWaker;
+cfg_not_sync! {
+ cfg_atomic_waker! {
+ mod task;
+ pub(crate) use task::AtomicWaker;
+ }
-pub mod watch;
+ cfg_rt_threaded! {
+ pub(crate) mod oneshot;
+ }
+
+ cfg_signal! {
+ pub(crate) mod mpsc;
+ pub(crate) mod semaphore;
+ }
+}
/// Unit tests
#[cfg(test)]