fix yield perf

This commit is contained in:
Carl Lerche
2023-05-17 15:44:07 -07:00
parent cbade61073
commit 55c6be901c
2 changed files with 4 additions and 5 deletions
@@ -15,11 +15,6 @@ pub(super) struct Idle {
/// Used to catch false-negatives when notifying workers.
needs_searching: AtomicBool,
// /// Tracks both the number of searching workers and the number of unparked
// /// workers.
// ///
// /// Used as a fast-path to avoid acquiring the lock when needed.
// state: AtomicUsize,
/// Sleeping workers
sleepers: Mutex<Vec<usize>>,
@@ -703,6 +703,10 @@ impl Core {
}
fn transition_to_searching(&mut self, worker: &Worker) -> bool {
if did_defer_tasks() {
return false;
}
if !self.is_searching {
self.is_searching = worker
.handle