This commit is contained in:
Carl Lerche
2023-05-16 17:42:30 -07:00
parent 2a1e36ac44
commit d98aed5789
2 changed files with 10 additions and 10 deletions
@@ -721,14 +721,14 @@ impl Core {
if self.is_searching {
self.is_searching = false;
if worker.handle.shared.idle.transition_worker_from_searching() {
if worker.handle.work_to_steal() {
// Transition *back* to searching
self.is_searching = true;
worker.handle.shared.idle.transition_worker_to_searching();
if worker.handle.shared.idle.transition_worker_from_searching()
&& worker.handle.work_to_steal()
{
// Transition *back* to searching
self.is_searching = true;
worker.handle.shared.idle.transition_worker_to_searching();
return false;
}
return false;
}
}
@@ -869,7 +869,7 @@ impl Handle {
.push_back(task, &self.shared.inject, &mut core.metrics);
} else {
// Push to the LIFO slot
let prev = core.lifo_slot(&self).swap_local(task);
let prev = core.lifo_slot(self).swap_local(task);
if let Some(prev) = prev {
core.run_queue
+2 -2
View File
@@ -54,7 +54,7 @@ impl<S> AtomicCell<S> {
if self
.task
.compare_exchange(prev, next, Release, Acquire)
.compare_exchange(prev, next, AcqRel, Acquire)
.is_ok()
{
// Safety: we already checked !null above
@@ -85,6 +85,6 @@ impl<S> AtomicCell<S> {
return Some(unsafe { Notified::from_raw(NonNull::new_unchecked(task)) });
}
return None;
None
}
}