mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00

When spawning using `Handle` while on the executor, tasks were being double counted. This prevented the number of active tasks to reach zero, thus preventing the executor from shutting down. This changes `spawn` to check if being called from the executor **before** incrementing the number of active tasks. Fixes #760