diff options
Diffstat (limited to 'tokio/src/sync/mpsc')
-rw-r--r-- | tokio/src/sync/mpsc/bounded.rs | 8 | ||||
-rw-r--r-- | tokio/src/sync/mpsc/chan.rs | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tokio/src/sync/mpsc/bounded.rs b/tokio/src/sync/mpsc/bounded.rs index 76439a8d..06b37173 100644 --- a/tokio/src/sync/mpsc/bounded.rs +++ b/tokio/src/sync/mpsc/bounded.rs @@ -178,9 +178,9 @@ impl<T> Receiver<T> { /// sync_code.join().unwrap() /// } /// ``` + #[cfg(feature = "sync")] pub fn blocking_recv(&mut self) -> Option<T> { - let mut enter_handle = crate::runtime::enter::enter(false); - enter_handle.block_on(self.recv()).unwrap() + crate::future::block_on(self.recv()) } /// Attempts to return a pending value on this receiver without blocking. @@ -518,9 +518,9 @@ impl<T> Sender<T> { /// sync_code.join().unwrap() /// } /// ``` + #[cfg(feature = "sync")] pub fn blocking_send(&self, value: T) -> Result<(), SendError<T>> { - let mut enter_handle = crate::runtime::enter::enter(false); - enter_handle.block_on(self.send(value)).unwrap() + crate::future::block_on(self.send(value)) } /// Checks if the channel has been closed. This happens when the diff --git a/tokio/src/sync/mpsc/chan.rs b/tokio/src/sync/mpsc/chan.rs index 3f50493e..c78fb501 100644 --- a/tokio/src/sync/mpsc/chan.rs +++ b/tokio/src/sync/mpsc/chan.rs @@ -4,7 +4,7 @@ use crate::loom::sync::atomic::AtomicUsize; use crate::loom::sync::Arc; use crate::sync::mpsc::error::TryRecvError; use crate::sync::mpsc::list; -use crate::sync::Notify; +use crate::sync::notify::Notify; use std::fmt; use std::process; |