From 6fd9084d470aa34e02c9dedcbf52e310fcb9cacc Mon Sep 17 00:00:00 2001 From: Alice Ryhl Date: Sat, 6 Feb 2021 19:08:59 +0100 Subject: [PATCH] runtime: add link to LocalSet on new_current_thread (#3508) --- tokio/src/runtime/builder.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tokio/src/runtime/builder.rs b/tokio/src/runtime/builder.rs index e84519297..33b63e1fe 100644 --- a/tokio/src/runtime/builder.rs +++ b/tokio/src/runtime/builder.rs @@ -86,6 +86,11 @@ impl Builder { /// Returns a new builder with the current thread scheduler selected. /// /// Configuration methods can be chained on the return value. + /// + /// To spawn non-`Send` tasks on the resulting runtime, combine it with a + /// [`LocalSet`]. + /// + /// [`LocalSet`]: crate::task::LocalSet pub fn new_current_thread() -> Builder { Builder::new(Kind::CurrentThread) }