diff options
| author | Dániel Buga <[email protected]> | 2023-08-14 08:22:22 +0200 |
|---|---|---|
| committer | Dániel Buga <[email protected]> | 2023-08-14 08:22:22 +0200 |
| commit | ec6bd27df6101bc5f77fa4eace0e8963970231ad (patch) | |
| tree | ecbee40838f3300b1419c855d5e8ec3f17e4ef48 /embassy-executor/src/thread.rs | |
| parent | 6ab0d71d9246cdc65f392212d03d639a51d21098 (diff) | |
Remove thread-context feature
Diffstat (limited to 'embassy-executor/src/thread.rs')
| -rw-r--r-- | embassy-executor/src/thread.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/embassy-executor/src/thread.rs b/embassy-executor/src/thread.rs index f977d41e7..ef703003d 100644 --- a/embassy-executor/src/thread.rs +++ b/embassy-executor/src/thread.rs | |||
| @@ -13,7 +13,6 @@ pub trait ThreadContext: Sized { | |||
| 13 | /// | 13 | /// |
| 14 | /// For example, on multi-core systems, this can be used to store the ID of the core that | 14 | /// For example, on multi-core systems, this can be used to store the ID of the core that |
| 15 | /// should be woken up. | 15 | /// should be woken up. |
| 16 | #[cfg(feature = "thread-context")] | ||
| 17 | fn context(&self) -> OpaqueThreadContext; | 16 | fn context(&self) -> OpaqueThreadContext; |
| 18 | 17 | ||
| 19 | /// Waits for the executor to be waken. | 18 | /// Waits for the executor to be waken. |
| @@ -49,16 +48,10 @@ impl<C: ThreadContext> ThreadModeExecutor<C> { | |||
| 49 | } | 48 | } |
| 50 | 49 | ||
| 51 | /// Create a new Executor using the given thread context. | 50 | /// Create a new Executor using the given thread context. |
| 52 | pub fn with_context(thread_context: C) -> Self { | 51 | pub fn with_context(context: C) -> Self { |
| 53 | #[cfg(not(feature = "thread-context"))] | ||
| 54 | let context = OpaqueThreadContext(()); | ||
| 55 | |||
| 56 | #[cfg(feature = "thread-context")] | ||
| 57 | let context = thread_context.context(); | ||
| 58 | |||
| 59 | Self { | 52 | Self { |
| 60 | inner: raw::Executor::new(Pender::Thread(context)), | 53 | inner: raw::Executor::new(Pender::Thread(context.context())), |
| 61 | context: thread_context, | 54 | context, |
| 62 | not_send: PhantomData, | 55 | not_send: PhantomData, |
| 63 | } | 56 | } |
| 64 | } | 57 | } |
