mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
clear the bit
This commit is contained in:
@@ -830,7 +830,7 @@ impl Context {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.steal_stranded_lifo(&mut core) {
|
if self.steal_stranded_lifo() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -842,23 +842,21 @@ impl Context {
|
|||||||
core
|
core
|
||||||
}
|
}
|
||||||
|
|
||||||
fn steal_stranded_lifo(&self, _core: &mut Core) -> bool {
|
fn steal_stranded_lifo(&self) -> bool {
|
||||||
if !self.worker.handle.shared.idle.should_attempt_lifo_steal() {
|
let shared = &self.worker.handle.shared;
|
||||||
|
if !shared.idle.should_attempt_lifo_steal() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
let remotes = self.worker.handle.shared.remotes.iter().enumerate();
|
for (i, remote) in shared.remotes.iter().enumerate() {
|
||||||
for (i, remote) in remotes {
|
|
||||||
if i != self.worker.index && remote.steal.has_lifo() {
|
if i != self.worker.index && remote.steal.has_lifo() {
|
||||||
self.worker
|
shared.idle.unpark_worker_by_id(shared, self.worker.index);
|
||||||
.handle
|
|
||||||
.shared
|
|
||||||
.idle
|
|
||||||
.unpark_worker_by_id(&self.worker.handle.shared, self.worker.index);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// didn't find any lifo task, unset the lifo steal bit.
|
||||||
|
shared.idle.clear_lifo();
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user