summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime/mod.rs
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2020-03-05 10:31:37 -0800
committerGitHub <noreply@github.com>2020-03-05 10:31:37 -0800
commita78b1c65ccfb9692ca5d3ed8ddde934f40091d83 (patch)
treec88e547d6913b204f590aea54dc03328ee3cb094 /tokio/src/runtime/mod.rs
parent5ede2e4d6b2f732e83e33f9693682dffc6c9f5b0 (diff)
rt: cleanup and simplify scheduler (scheduler v2.5) (#2273)
A refactor of the scheduler internals focusing on simplifying and reducing unsafety. There are no fundamental logic changes. * The state transitions of the core task component are refined and reduced. * `basic_scheduler` has most unsafety removed. * `local_set` has most unsafety removed. * `threaded_scheduler` limits most unsafety to its queue implementation.
Diffstat (limited to 'tokio/src/runtime/mod.rs')
-rw-r--r--tokio/src/runtime/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs
index 6922ef59..3aafc406 100644
--- a/tokio/src/runtime/mod.rs
+++ b/tokio/src/runtime/mod.rs
@@ -187,11 +187,14 @@
#[cfg(test)]
#[macro_use]
mod tests;
+
pub(crate) mod context;
cfg_rt_core! {
mod basic_scheduler;
use basic_scheduler::BasicScheduler;
+
+ pub(crate) mod task;
}
mod blocking;
@@ -215,7 +218,7 @@ mod io;
cfg_rt_threaded! {
mod park;
- use park::{Parker, Unparker};
+ use park::Parker;
}
mod shell;
@@ -334,7 +337,7 @@ impl Runtime {
/// [threaded scheduler]: index.html#threaded-scheduler
/// [basic scheduler]: index.html#basic-scheduler
/// [runtime builder]: crate::runtime::Builder
- pub fn new() -> io::Result<Self> {
+ pub fn new() -> io::Result<Runtime> {
#[cfg(feature = "rt-threaded")]
let ret = Builder::new().threaded_scheduler().enable_all().build();