diff --git a/src/spawn.rs b/src/spawn.rs index 4741948..b31494d 100644 --- a/src/spawn.rs +++ b/src/spawn.rs @@ -49,7 +49,11 @@ pub fn spawn(future: impl Future + Send + 'static .expect("cannot spawn executor thread"); } - Executor::new() + // Prevent spawning another thread by running the process driver on this thread. + let ex = Executor::new(); + #[cfg(not(target_os = "espidf"))] + ex.spawn(async_process::driver()).detach(); + ex }) }