mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 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
|
// First, we need to block the other worker until all tasks have
|
||||||
// been spawned.
|
// been spawned.
|
||||||
tokio::spawn(async move {
|
//
|
||||||
tx1.send(()).unwrap();
|
// We spawn from outside the runtime to ensure that the other worker
|
||||||
rx2.recv().unwrap();
|
// 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();
|
rx1.recv().unwrap();
|
||||||
|
|
||||||
// Spawn many tasks
|
// Spawn many tasks
|
||||||
|
|||||||
Reference in New Issue
Block a user