Skip to content

Commit

Permalink
task: add guarantee about when a spawned task may be polled (#5816)
Browse files Browse the repository at this point in the history
  • Loading branch information
Diggsey committed Jun 27, 2023
1 parent 6b076a2 commit 657fd88
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tokio/src/task/spawn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ cfg_rt! {
/// different thread to be executed. The specifics depend on the current
/// [`Runtime`](crate::runtime::Runtime) configuration.
///
/// It is guaranteed that spawn will not synchronously poll the task being spawned.
/// This means that calling spawn while holding a lock does not pose a risk of
/// deadlocking with the spawned task.
///
/// There is no guarantee that a spawned task will execute to completion.
/// When a runtime is shutdown, all outstanding tasks are dropped,
/// regardless of the lifecycle of that task.
Expand Down

0 comments on commit 657fd88

Please sign in to comment.