mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-17 00:00:11 +02:00
@@ -471,14 +471,17 @@ fn worker_overflow_count() {
|
||||
|
||||
// First, we need to block the other worker until all tasks have
|
||||
// been spawned.
|
||||
tokio::spawn(async move {
|
||||
tx1.send(()).unwrap();
|
||||
rx2.recv().unwrap();
|
||||
//
|
||||
// We spawn from outside the runtime to ensure that the other worker
|
||||
// will pick it up:
|
||||
// <https://github.com/tokio-rs/tokio/issues/4730>
|
||||
tokio::task::spawn_blocking(|| {
|
||||
tokio::spawn(async move {
|
||||
tx1.send(()).unwrap();
|
||||
rx2.recv().unwrap();
|
||||
});
|
||||
});
|
||||
|
||||
// Bump the next-run spawn
|
||||
tokio::spawn(async {});
|
||||
|
||||
rx1.recv().unwrap();
|
||||
|
||||
// Spawn many tasks
|
||||
|
||||
Reference in New Issue
Block a user