mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +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.
|
/// Used to catch false-negatives when notifying workers.
|
||||||
needs_searching: AtomicBool,
|
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
|
/// Sleeping workers
|
||||||
sleepers: Mutex<Vec<usize>>,
|
sleepers: Mutex<Vec<usize>>,
|
||||||
|
|
||||||
|
|||||||
@@ -703,6 +703,10 @@ impl Core {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn transition_to_searching(&mut self, worker: &Worker) -> bool {
|
fn transition_to_searching(&mut self, worker: &Worker) -> bool {
|
||||||
|
if did_defer_tasks() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if !self.is_searching {
|
if !self.is_searching {
|
||||||
self.is_searching = worker
|
self.is_searching = worker
|
||||||
.handle
|
.handle
|
||||||
|
|||||||
Reference in New Issue
Block a user