Skip to content

Commit

Permalink
task: improve JoinHandle::abort cancellation doc (#4121)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlinc committed Sep 21, 2021
1 parent 8e54145 commit d9b2dc8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tokio/src/runtime/task/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl<T> JoinHandle<T> {
///
/// Awaiting a cancelled task might complete as usual if the task was
/// already completed at the time it was cancelled, but most likely it
/// will complete with a `Err(JoinError::Cancelled)`.
/// will fail with a [cancelled] `JoinError`.
///
/// ```rust
/// use tokio::time;
Expand Down Expand Up @@ -190,6 +190,7 @@ impl<T> JoinHandle<T> {
/// }
/// }
/// ```
/// [cancelled]: method@super::error::JoinError::is_cancelled
pub fn abort(&self) {
if let Some(raw) = self.raw {
raw.remote_abort();
Expand Down

0 comments on commit d9b2dc8

Please sign in to comment.