From 925314ba43efb18af6b57c666d1f2f1a4a806b76 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 31 May 2022 20:08:53 +0100 Subject: [PATCH] doc: clarify semantics of tasks outliving block_on (#4729) --- tokio/src/runtime/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tokio/src/runtime/mod.rs b/tokio/src/runtime/mod.rs index bd428525d..a030ccdf0 100644 --- a/tokio/src/runtime/mod.rs +++ b/tokio/src/runtime/mod.rs @@ -435,6 +435,8 @@ cfg_rt! { /// When the multi thread scheduler is used this will allow futures /// to run within the io driver and timer context of the overall runtime. /// + /// Any spawned tasks will continue running after `block_on` returns. + /// /// # Current thread scheduler /// /// When the current thread scheduler is enabled `block_on` @@ -444,6 +446,9 @@ cfg_rt! { /// When the first `block_on` completes, other threads will be able to /// "steal" the driver to allow continued execution of their futures. /// + /// Any spawned tasks will be suspended after `block_on` returns. Calling + /// `block_on` again will resume previously spawned tasks. + /// /// # Panics /// /// This function panics if the provided future panics, or if called within an