rt: Remove threaded_scheduler() and basic_scheduler() (#2876)

Co-authored-by: Alice Ryhl <[email protected]>
Co-authored-by: Carl Lerche <[email protected]>
This commit is contained in:
Lucio Franco
2020-10-12 13:44:54 -04:00
committed by GitHub
co-authored by Alice Ryhl Carl Lerche
parent 0893841f31
commit 8880222036
90 changed files with 1480 additions and 1698 deletions
+9 -12
View File
@@ -1,4 +1,4 @@
#![cfg(feature = "macros")]
#![cfg(all(feature = "macros", feature = "rt-core"))]
#[tokio::main]
async fn basic_main() -> usize {
@@ -10,18 +10,15 @@ async fn generic_fun<T: Default>() -> T {
T::default()
}
#[cfg(feature = "rt-core")]
mod spawn {
#[tokio::main]
async fn spawning() -> usize {
let join = tokio::spawn(async { 1 });
join.await.unwrap()
}
#[tokio::main]
async fn spawning() -> usize {
let join = tokio::spawn(async { 1 });
join.await.unwrap()
}
#[test]
fn main_with_spawn() {
assert_eq!(1, spawning());
}
#[test]
fn main_with_spawn() {
assert_eq!(1, spawning());
}
#[test]
-32
View File
@@ -1,32 +0,0 @@
#![warn(rust_2018_idioms)]
#![cfg(feature = "sync")]
use tokio::runtime;
use tokio::sync::oneshot;
use std::sync::mpsc;
use std::thread;
#[test]
fn basic_shell_rt() {
let (feed_tx, feed_rx) = mpsc::channel::<oneshot::Sender<()>>();
let th = thread::spawn(move || {
for tx in feed_rx.iter() {
tx.send(()).unwrap();
}
});
for _ in 0..1_000 {
let rt = runtime::Builder::new().build().unwrap();
let (tx, rx) = oneshot::channel();
feed_tx.send(tx).unwrap();
rt.block_on(rx).unwrap();
}
drop(feed_tx);
th.join().unwrap();
}