summaryrefslogtreecommitdiffstats
path: root/tokio/src/sync
diff options
context:
space:
mode:
authorLucio Franco <luciofranco14@gmail.com>2020-10-12 13:44:54 -0400
committerGitHub <noreply@github.com>2020-10-12 13:44:54 -0400
commit8880222036f37c6204c8466f25e828447f16dacb (patch)
treefd623afc20f73bbce65746a3d1b1b2731ecf30a5 /tokio/src/sync
parent0893841f31542b2b04c5050a8a4a3c45cf867e55 (diff)
rt: Remove `threaded_scheduler()` and `basic_scheduler()` (#2876)
Co-authored-by: Alice Ryhl <alice@ryhl.io> Co-authored-by: Carl Lerche <me@carllerche.com>
Diffstat (limited to 'tokio/src/sync')
-rw-r--r--tokio/src/sync/mod.rs6
-rw-r--r--tokio/src/sync/mpsc/bounded.rs8
-rw-r--r--tokio/src/sync/mpsc/chan.rs2
3 files changed, 8 insertions, 8 deletions
diff --git a/tokio/src/sync/mod.rs b/tokio/src/sync/mod.rs
index ed9f07a0..ddb289eb 100644
--- a/tokio/src/sync/mod.rs
+++ b/tokio/src/sync/mod.rs
@@ -437,7 +437,7 @@ cfg_sync! {
mod mutex;
pub use mutex::{Mutex, MutexGuard, TryLockError, OwnedMutexGuard};
- mod notify;
+ pub(crate) mod notify;
pub use notify::Notify;
pub mod oneshot;
@@ -464,8 +464,8 @@ cfg_not_sync! {
pub(crate) use mutex::Mutex;
}
- mod notify;
- pub(crate) use notify::Notify;
+ #[cfg(any(feature = "rt-core", feature = "signal", all(unix, feature = "process")))]
+ pub(crate) mod notify;
cfg_atomic_waker_impl! {
mod task;
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;