diff options
| author | Kaspar Schleiser <[email protected]> | 2024-01-22 21:50:34 +0100 |
|---|---|---|
| committer | Kaspar Schleiser <[email protected]> | 2025-04-04 22:32:55 +0200 |
| commit | 89f3566419a4987a5fa1420993322456c1849fef (patch) | |
| tree | 9d086ba4eafaac457009d6d67c4ceeb9ebdd7abb | |
| parent | 3f87ce6f50865b04a56b50476aa6cc7a0f92f0e9 (diff) | |
embassy_executor: introduce `Spawner::executor_id()`
| -rw-r--r-- | embassy-executor/src/spawner.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/embassy-executor/src/spawner.rs b/embassy-executor/src/spawner.rs index 9817a2870..ff243081c 100644 --- a/embassy-executor/src/spawner.rs +++ b/embassy-executor/src/spawner.rs | |||
| @@ -173,6 +173,11 @@ impl Spawner { | |||
| 173 | pub fn make_send(&self) -> SendSpawner { | 173 | pub fn make_send(&self) -> SendSpawner { |
| 174 | SendSpawner::new(&self.executor.inner) | 174 | SendSpawner::new(&self.executor.inner) |
| 175 | } | 175 | } |
| 176 | |||
| 177 | /// Return the unique ID of this Spawner's Executor. | ||
| 178 | pub fn executor_id(&self) -> usize { | ||
| 179 | self.executor.id() | ||
| 180 | } | ||
| 176 | } | 181 | } |
| 177 | 182 | ||
| 178 | /// Handle to spawn tasks into an executor from any thread. | 183 | /// Handle to spawn tasks into an executor from any thread. |
