mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
fix yield perf
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user