From 5bbf9762681ae75c6489558e15f894d0466516a3 Mon Sep 17 00:00:00 2001 From: gliderkite Date: Wed, 22 Jan 2020 16:34:09 +0000 Subject: Enhance documentation of tokio::task::block_in_place (#2155) --- tokio/src/task/blocking.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tokio/src/task') diff --git a/tokio/src/task/blocking.rs b/tokio/src/task/blocking.rs index a155197f..69f4cf0a 100644 --- a/tokio/src/task/blocking.rs +++ b/tokio/src/task/blocking.rs @@ -10,6 +10,12 @@ cfg_rt_threaded! { /// (possibly new) thread, and only then poll the task. Note that this requires /// additional synchronization. /// + /// # Note + /// + /// This function can only be called from a spawned task when working with + /// the [threaded scheduler](https://docs.rs/tokio/0.2.10/tokio/runtime/index.html#threaded-scheduler). + /// Consider using [tokio::task::spawn_blocking](https://docs.rs/tokio/0.2.10/tokio/task/fn.spawn_blocking.html). + /// /// # Examples /// /// ``` -- cgit v1.2.3