We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 38d1bcd commit 7c54fdcCopy full SHA for 7c54fdc
tokio/src/runtime/scheduler/multi_thread/worker.rs
@@ -787,6 +787,10 @@ impl Core {
787
cap,
788
);
789
790
+ // Take at least one task since the first task is returned directly
791
+ // and nto pushed onto the local queue.
792
+ let n = usize::max(1, n);
793
+
794
let mut synced = worker.handle.shared.synced.lock();
795
// safety: passing in the correct `inject::Synced`.
796
let mut tasks = unsafe { worker.inject().pop_n(&mut synced.inject, n) };
0 commit comments