mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
rt: switch enter to an RAII guard (#2954)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user