mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00

Previously, every call to `current_thread::Handle::spawn` would go through a `mpsc` channel. This is unnecessary when the `Handle` is still on the same thread as the current thread executor. This patch fixes that by storing the `ThreadId` of the executor when it is created, and then comparing against that when `Handle::spawn` is called. If the call is made from the same thread, `spawn_local` is used directly. Fixes #562.
tokio-current-thread
Single threaded executor for Tokio.
Overview
This crate provides the single threaded executor which execute many tasks concurrently.
License
This project is licensed under the MIT license.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in Tokio by you, shall be licensed as MIT, without any additional terms or conditions.