aboutsummaryrefslogtreecommitdiff
path: root/src/task/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/task/mod.rs')
-rw-r--r--src/task/mod.rs29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/task/mod.rs b/src/task/mod.rs
index ea98787..9b75370 100644
--- a/src/task/mod.rs
+++ b/src/task/mod.rs
@@ -243,7 +243,7 @@
//!
//! #### unconstrained
//!
-//! If necessary, [`task::unconstrained`] lets you opt out a future of Tokio's cooperative
+//! If necessary, [`task::unconstrained`] lets you opt a future out of of Tokio's cooperative
//! scheduling. When a future is wrapped with `unconstrained`, it will never be forced to yield to
//! Tokio. For example:
//!
@@ -278,8 +278,10 @@
cfg_rt! {
pub use crate::runtime::task::{JoinError, JoinHandle};
- mod blocking;
- pub use blocking::spawn_blocking;
+ cfg_not_wasi! {
+ mod blocking;
+ pub use blocking::spawn_blocking;
+ }
mod spawn;
pub use spawn::spawn;
@@ -291,8 +293,13 @@ cfg_rt! {
mod yield_now;
pub use yield_now::yield_now;
+ cfg_unstable! {
+ mod consume_budget;
+ pub use consume_budget::consume_budget;
+ }
+
mod local;
- pub use local::{spawn_local, LocalSet};
+ pub use local::{spawn_local, LocalSet, LocalEnterGuard};
mod task_local;
pub use task_local::LocalKey;
@@ -300,6 +307,20 @@ cfg_rt! {
mod unconstrained;
pub use unconstrained::{unconstrained, Unconstrained};
+ #[doc(inline)]
+ pub use join_set::JoinSet;
+ pub use crate::runtime::task::AbortHandle;
+
+ // Uses #[cfg(...)] instead of macro since the macro adds docsrs annotations.
+ #[cfg(not(tokio_unstable))]
+ mod join_set;
+ #[cfg(tokio_unstable)]
+ pub mod join_set;
+
+ cfg_unstable! {
+ pub use crate::runtime::task::{Id, id, try_id};
+ }
+
cfg_trace! {
mod builder;
pub use builder::Builder;