summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime/task/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/src/runtime/task/mod.rs')
-rw-r--r--tokio/src/runtime/task/mod.rs34
1 files changed, 18 insertions, 16 deletions
diff --git a/tokio/src/runtime/task/mod.rs b/tokio/src/runtime/task/mod.rs
index 17b5157e..d30a467f 100644
--- a/tokio/src/runtime/task/mod.rs
+++ b/tokio/src/runtime/task/mod.rs
@@ -79,22 +79,24 @@ pub(crate) trait Schedule: Sync + Sized + 'static {
}
}
-/// Create a new task with an associated join handle
-pub(crate) fn joinable<T, S>(task: T) -> (Notified<S>, JoinHandle<T::Output>)
-where
- T: Future + Send + 'static,
- S: Schedule,
-{
- let raw = RawTask::new::<_, S>(task);
-
- let task = Task {
- raw,
- _p: PhantomData,
- };
-
- let join = JoinHandle::new(raw);
-
- (Notified(task), join)
+cfg_rt_core! {
+ /// Create a new task with an associated join handle
+ pub(crate) fn joinable<T, S>(task: T) -> (Notified<S>, JoinHandle<T::Output>)
+ where
+ T: Future + Send + 'static,
+ S: Schedule,
+ {
+ let raw = RawTask::new::<_, S>(task);
+
+ let task = Task {
+ raw,
+ _p: PhantomData,
+ };
+
+ let join = JoinHandle::new(raw);
+
+ (Notified(task), join)
+ }
}
cfg_rt_util! {