diff options
| -rw-r--r-- | embassy-executor/src/arch/cortex_m.rs | 4 | ||||
| -rw-r--r-- | embassy-executor/src/arch/riscv32.rs | 5 | ||||
| -rw-r--r-- | embassy-executor/src/arch/std.rs | 6 | ||||
| -rw-r--r-- | embassy-executor/src/arch/xtensa.rs | 11 |
4 files changed, 5 insertions, 21 deletions
diff --git a/embassy-executor/src/arch/cortex_m.rs b/embassy-executor/src/arch/cortex_m.rs index ca1675c03..355a0f086 100644 --- a/embassy-executor/src/arch/cortex_m.rs +++ b/embassy-executor/src/arch/cortex_m.rs | |||
| @@ -18,9 +18,7 @@ mod thread { | |||
| 18 | /// TODO | 18 | /// TODO |
| 19 | // Name pending | 19 | // Name pending |
| 20 | #[derive(Default)] // Default enables Executor::new | 20 | #[derive(Default)] // Default enables Executor::new |
| 21 | pub struct CortexMThreadContext { | 21 | pub struct CortexMThreadContext; |
| 22 | _not_send: core::marker::PhantomData<*mut ()>, | ||
| 23 | } | ||
| 24 | 22 | ||
| 25 | impl ThreadContext for CortexMThreadContext { | 23 | impl ThreadContext for CortexMThreadContext { |
| 26 | #[cfg(feature = "thread-context")] | 24 | #[cfg(feature = "thread-context")] |
diff --git a/embassy-executor/src/arch/riscv32.rs b/embassy-executor/src/arch/riscv32.rs index 5f766442d..becc0245a 100644 --- a/embassy-executor/src/arch/riscv32.rs +++ b/embassy-executor/src/arch/riscv32.rs | |||
| @@ -8,7 +8,6 @@ compile_error!("`thread-context` is not supported with `arch-riscv32`."); | |||
| 8 | pub use thread::*; | 8 | pub use thread::*; |
| 9 | #[cfg(feature = "executor-thread")] | 9 | #[cfg(feature = "executor-thread")] |
| 10 | mod thread { | 10 | mod thread { |
| 11 | use core::marker::PhantomData; | ||
| 12 | use core::sync::atomic::{AtomicBool, Ordering}; | 11 | use core::sync::atomic::{AtomicBool, Ordering}; |
| 13 | 12 | ||
| 14 | #[cfg(feature = "nightly")] | 13 | #[cfg(feature = "nightly")] |
| @@ -28,9 +27,7 @@ mod thread { | |||
| 28 | /// TODO | 27 | /// TODO |
| 29 | // Name pending | 28 | // Name pending |
| 30 | #[derive(Default)] // Default enables Executor::new | 29 | #[derive(Default)] // Default enables Executor::new |
| 31 | pub struct RiscVThreadContext { | 30 | pub struct RiscVThreadContext; |
| 32 | _not_send: PhantomData<*mut ()>, | ||
| 33 | } | ||
| 34 | 31 | ||
| 35 | impl ThreadContext for RiscVThreadContext { | 32 | impl ThreadContext for RiscVThreadContext { |
| 36 | fn context(&self) -> OpaqueThreadContext { | 33 | fn context(&self) -> OpaqueThreadContext { |
diff --git a/embassy-executor/src/arch/std.rs b/embassy-executor/src/arch/std.rs index 28e25fbd0..b08974a02 100644 --- a/embassy-executor/src/arch/std.rs +++ b/embassy-executor/src/arch/std.rs | |||
| @@ -8,7 +8,6 @@ compile_error!("`arch-std` requires `thread-context`."); | |||
| 8 | pub use thread::*; | 8 | pub use thread::*; |
| 9 | #[cfg(feature = "executor-thread")] | 9 | #[cfg(feature = "executor-thread")] |
| 10 | mod thread { | 10 | mod thread { |
| 11 | use std::marker::PhantomData; | ||
| 12 | use std::sync::{Condvar, Mutex}; | 11 | use std::sync::{Condvar, Mutex}; |
| 13 | 12 | ||
| 14 | #[cfg(feature = "nightly")] | 13 | #[cfg(feature = "nightly")] |
| @@ -20,16 +19,13 @@ mod thread { | |||
| 20 | /// TODO | 19 | /// TODO |
| 21 | // Name pending | 20 | // Name pending |
| 22 | pub struct StdThreadCtx { | 21 | pub struct StdThreadCtx { |
| 23 | _not_send: PhantomData<*mut ()>, | ||
| 24 | signaler: &'static Signaler, | 22 | signaler: &'static Signaler, |
| 25 | } | 23 | } |
| 26 | 24 | ||
| 27 | impl Default for StdThreadCtx { | 25 | impl Default for StdThreadCtx { |
| 28 | fn default() -> Self { | 26 | fn default() -> Self { |
| 29 | let signaler = &*Box::leak(Box::new(Signaler::new())); | ||
| 30 | Self { | 27 | Self { |
| 31 | _not_send: PhantomData, | 28 | signaler: &*Box::leak(Box::new(Signaler::new())), |
| 32 | signaler, | ||
| 33 | } | 29 | } |
| 34 | } | 30 | } |
| 35 | } | 31 | } |
diff --git a/embassy-executor/src/arch/xtensa.rs b/embassy-executor/src/arch/xtensa.rs index 8e1b917de..6357bfef2 100644 --- a/embassy-executor/src/arch/xtensa.rs +++ b/embassy-executor/src/arch/xtensa.rs | |||
| @@ -27,15 +27,8 @@ mod thread { | |||
| 27 | 27 | ||
| 28 | /// TODO | 28 | /// TODO |
| 29 | // Name pending | 29 | // Name pending |
| 30 | pub struct XtensaThreadContext { | 30 | #[derive(Default)] // Default enables Executor::new |
| 31 | _not_send: PhantomData<*mut ()>, | 31 | pub struct XtensaThreadContext; |
| 32 | } | ||
| 33 | |||
| 34 | impl Default for XtensaThreadContext { | ||
| 35 | fn default() -> Self { | ||
| 36 | Self { _not_send: PhantomData } | ||
| 37 | } | ||
| 38 | } | ||
| 39 | 32 | ||
| 40 | impl ThreadContext for XtensaThreadContext { | 33 | impl ThreadContext for XtensaThreadContext { |
| 41 | fn context(&self) -> OpaqueThreadContext { | 34 | fn context(&self) -> OpaqueThreadContext { |
