mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-07 00:46:43 +00:00
fix(rt): use task::block_on on spawned threads
This makes sure to capture threads into the recursive block_on detection.
This commit is contained in:
parent
e12cf80ab0
commit
5a1a681d68
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ pub static RUNTIME: Lazy<Runtime> = Lazy::new(|| {
|
||||||
for _ in 0..thread_count {
|
for _ in 0..thread_count {
|
||||||
thread::Builder::new()
|
thread::Builder::new()
|
||||||
.name(thread_name.clone())
|
.name(thread_name.clone())
|
||||||
.spawn(|| smol::run(future::pending::<()>()))
|
.spawn(|| crate::task::block_on(future::pending::<()>()))
|
||||||
.expect("cannot start a runtime thread");
|
.expect("cannot start a runtime thread");
|
||||||
}
|
}
|
||||||
Runtime {}
|
Runtime {}
|
||||||
|
|
Loading…
Reference in a new issue