Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions tokio/src/runtime/task/join.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::runtime::task::{Header, RawTask};
use crate::runtime::task::{AbortHandle, Header, RawTask};

use std::fmt;
use std::future::Future;
Expand All @@ -22,6 +22,10 @@ cfg_rt! {
/// This `struct` is created by the [`task::spawn`] and [`task::spawn_blocking`]
/// functions.
///
/// It is guaranteed that the destructor of the spawned task has finished
/// before task completion is observed via `JoinHandle` `await`,
/// [`JoinHandle::is_finished`] or [`AbortHandle::is_finished`].
///
/// # Cancel safety
///
/// The `&mut JoinHandle<T>` type is cancel safe. If it is used as the event
Expand Down Expand Up @@ -300,9 +304,9 @@ impl<T> JoinHandle<T> {
/// ```
/// [cancelled]: method@super::error::JoinError::is_cancelled
#[must_use = "abort handles do nothing unless `.abort` is called"]
pub fn abort_handle(&self) -> super::AbortHandle {
pub fn abort_handle(&self) -> AbortHandle {
self.raw.ref_inc();
super::AbortHandle::new(self.raw)
AbortHandle::new(self.raw)
}

/// Returns a [task ID] that uniquely identifies this task relative to other
Expand Down