From 8880222036f37c6204c8466f25e828447f16dacb Mon Sep 17 00:00:00 2001 From: Lucio Franco Date: Mon, 12 Oct 2020 13:44:54 -0400 Subject: rt: Remove `threaded_scheduler()` and `basic_scheduler()` (#2876) Co-authored-by: Alice Ryhl Co-authored-by: Carl Lerche --- tokio/src/sync/mpsc/bounded.rs | 8 ++++---- tokio/src/sync/mpsc/chan.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'tokio/src/sync/mpsc') 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 Receiver { /// sync_code.join().unwrap() /// } /// ``` + #[cfg(feature = "sync")] pub fn blocking_recv(&mut self) -> Option { - 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 Sender { /// sync_code.join().unwrap() /// } /// ``` + #[cfg(feature = "sync")] pub fn blocking_send(&self, value: T) -> Result<(), SendError> { - 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; -- cgit v1.2.3