clear the bit

This commit is contained in:
Eliza Weisman
2026-04-18 14:15:36 -07:00
parent dc759b9dd6
commit 04353af3ea
@@ -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
} }