From 760a7667d60be306177d522bc622b144a73f0d98 Mon Sep 17 00:00:00 2001 From: Simon Farnsworth Date: Wed, 5 Dec 2018 20:20:19 +0000 Subject: [PATCH] threadpool: improve the documentation of `blocking` (#789) --- tokio-threadpool/src/blocking.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tokio-threadpool/src/blocking.rs b/tokio-threadpool/src/blocking.rs index fad78f107..88cdd15fe 100644 --- a/tokio-threadpool/src/blocking.rs +++ b/tokio-threadpool/src/blocking.rs @@ -25,6 +25,13 @@ pub struct BlockingError { /// calls complete. The maximum value is specified when creating a thread pool /// using [`Builder::max_blocking`][build] /// +/// NB: The entire task that called `blocking` is blocked whenever the supplied +/// closure blocks, even if you have used future combinators such as `select` - +/// the other futures in this task will not make progress until the closure +/// returns. +/// If this is not desired, ensure that `blocking` runs in its own task (e.g. +/// using `futures::sync::oneshot::spawn`). +/// /// [build]: struct.Builder.html#method.max_blocking /// /// # Return