summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime/blocking/pool.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/src/runtime/blocking/pool.rs')
-rw-r--r--tokio/src/runtime/blocking/pool.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/tokio/src/runtime/blocking/pool.rs b/tokio/src/runtime/blocking/pool.rs
index 2d44f896..d0f2c1c8 100644
--- a/tokio/src/runtime/blocking/pool.rs
+++ b/tokio/src/runtime/blocking/pool.rs
@@ -232,11 +232,9 @@ impl Spawner {
builder
.spawn(move || {
// Only the reference should be moved into the closure
- let rt = &rt;
- rt.enter(move || {
- rt.blocking_spawner.inner.run(worker_id);
- drop(shutdown_tx);
- })
+ let _enter = crate::runtime::context::enter(rt.clone());
+ rt.blocking_spawner.inner.run(worker_id);
+ drop(shutdown_tx);
})
.unwrap()
}