File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1- use crate :: runtime:: task:: { Header , RawTask } ;
1+ use crate :: runtime:: task:: { AbortHandle , Header , RawTask } ;
22
33use std:: fmt;
44use std:: future:: Future ;
@@ -22,6 +22,10 @@ cfg_rt! {
2222 /// This `struct` is created by the [`task::spawn`] and [`task::spawn_blocking`]
2323 /// functions.
2424 ///
25+ /// It is guaranteed that the destructor of the spawned task has finished
26+ /// before task completion is observed via `JoinHandle` `await`,
27+ /// [`JoinHandle::is_finished`] or [`AbortHandle::is_finished`].
28+ ///
2529 /// # Cancel safety
2630 ///
2731 /// The `&mut JoinHandle<T>` type is cancel safe. If it is used as the event
@@ -300,9 +304,9 @@ impl<T> JoinHandle<T> {
300304 /// ```
301305 /// [cancelled]: method@super::error::JoinError::is_cancelled
302306 #[ must_use = "abort handles do nothing unless `.abort` is called" ]
303- pub fn abort_handle ( & self ) -> super :: AbortHandle {
307+ pub fn abort_handle ( & self ) -> AbortHandle {
304308 self . raw . ref_inc ( ) ;
305- super :: AbortHandle :: new ( self . raw )
309+ AbortHandle :: new ( self . raw )
306310 }
307311
308312 /// Returns a [task ID] that uniquely identifies this task relative to other
You can’t perform that action at this time.
0 commit comments