From f25f12d57638a2928b3f738b3b1392d8773e276e Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Wed, 23 Sep 2020 14:35:10 -0400 Subject: rt: Allow concurrent `block_on`'s with basic_scheduler (#2804) --- tokio/src/sync/mod.rs | 7 +++++++ tokio/src/sync/notify.rs | 7 +++++++ 2 files changed, 14 insertions(+) (limited to 'tokio/src/sync') diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs index 1a584383..2e674136 100644 --- a/tokio/src/sync/mod.rs +++ b/tokio/src/sync/mod.rs @@ -456,6 +456,13 @@ cfg_sync! { pub mod watch; } +cfg_not_sync! { + cfg_rt_core! { + mod notify; + pub(crate) use notify::Notify; + } +} + cfg_not_sync! { cfg_atomic_waker_impl! { mod task; diff --git a/tokio/src/sync/notify.rs b/tokio/src/sync/notify.rs index 56bbc51b..d319e8aa 100644 --- a/tokio/src/sync/notify.rs +++ b/tokio/src/sync/notify.rs @@ -1,3 +1,10 @@ +// Allow `unreachable_pub` warnings when sync is not enabled +// due to the usage of `Notify` within the `rt-core` feature set. +// When this module is compiled with `sync` enabled we will warn on +// this lint. When `rt-core` is enabled we use `pub(crate)` which +// triggers this warning but it is safe to ignore in this case. +#![cfg_attr(not(feature = "sync"), allow(unreachable_pub, dead_code))] + use crate::loom::sync::atomic::AtomicU8; use crate::loom::sync::Mutex; use crate::util::linked_list::{self, LinkedList}; -- cgit v1.2.3