summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime/blocking
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-12-01 12:58:01 -0800
committerGitHub <noreply@github.com>2019-12-01 12:58:01 -0800
commita8a4a9f0fceb33162bfb34160ac8ceb098c65ee3 (patch)
tree5bbfdebe37af12368c4a65e45b9a1cdc90a84c96 /tokio/src/runtime/blocking
parent8b60c5386a60be4dacffe71823350040e8ba90fd (diff)
blocking: fix `spawn_blocking` after shutdown (#1875)
The task handle needs to be shutdown explicitly and not dropped. Closes #1853
Diffstat (limited to 'tokio/src/runtime/blocking')
-rw-r--r--tokio/src/runtime/blocking/pool.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tokio/src/runtime/blocking/pool.rs b/tokio/src/runtime/blocking/pool.rs
index 052d361a..3e7d401b 100644
--- a/tokio/src/runtime/blocking/pool.rs
+++ b/tokio/src/runtime/blocking/pool.rs
@@ -197,6 +197,9 @@ impl Spawner {
let mut shared = self.inner.shared.lock().unwrap();
if shared.shutdown {
+ // Shutdown the task
+ task.shutdown();
+
// no need to even push this task; it would never get picked up
return;
}