summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime/thread_pool
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/src/runtime/thread_pool')
-rw-r--r--tokio/src/runtime/thread_pool/worker.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/tokio/src/runtime/thread_pool/worker.rs b/tokio/src/runtime/thread_pool/worker.rs
index abe20da5..c53c9384 100644
--- a/tokio/src/runtime/thread_pool/worker.rs
+++ b/tokio/src/runtime/thread_pool/worker.rs
@@ -199,7 +199,6 @@ cfg_blocking! {
}
}
- let mut had_core = false;
let mut had_entered = false;
CURRENT.with(|maybe_cx| {
@@ -248,7 +247,6 @@ cfg_blocking! {
//
// First, move the core back into the worker's shared core slot.
cx.worker.core.set(core);
- had_core = true;
// Next, clone the worker handle and send it to a new thread for
// processing.
@@ -259,14 +257,12 @@ cfg_blocking! {
runtime::spawn_blocking(move || run(worker));
});
- if had_core {
+ if had_entered {
// Unset the current task's budget. Blocking sections are not
// constrained by task budgets.
let _reset = Reset(coop::stop());
crate::runtime::enter::exit(f)
- } else if had_entered {
- crate::runtime::enter::exit(f)
} else {
f()
}