Remove unnecessary !Send markers

This commit is contained in:
Dániel Buga 2023-08-12 22:08:46 +02:00
parent fbf50cdae8
commit bce250bbdc
4 changed files with 5 additions and 21 deletions

View File

@ -18,9 +18,7 @@ mod thread {
/// TODO /// TODO
// Name pending // Name pending
#[derive(Default)] // Default enables Executor::new #[derive(Default)] // Default enables Executor::new
pub struct CortexMThreadContext { pub struct CortexMThreadContext;
_not_send: core::marker::PhantomData<*mut ()>,
}
impl ThreadContext for CortexMThreadContext { impl ThreadContext for CortexMThreadContext {
#[cfg(feature = "thread-context")] #[cfg(feature = "thread-context")]

View File

@ -8,7 +8,6 @@ compile_error!("`thread-context` is not supported with `arch-riscv32`.");
pub use thread::*; pub use thread::*;
#[cfg(feature = "executor-thread")] #[cfg(feature = "executor-thread")]
mod thread { mod thread {
use core::marker::PhantomData;
use core::sync::atomic::{AtomicBool, Ordering}; use core::sync::atomic::{AtomicBool, Ordering};
#[cfg(feature = "nightly")] #[cfg(feature = "nightly")]
@ -28,9 +27,7 @@ mod thread {
/// TODO /// TODO
// Name pending // Name pending
#[derive(Default)] // Default enables Executor::new #[derive(Default)] // Default enables Executor::new
pub struct RiscVThreadContext { pub struct RiscVThreadContext;
_not_send: PhantomData<*mut ()>,
}
impl ThreadContext for RiscVThreadContext { impl ThreadContext for RiscVThreadContext {
fn context(&self) -> OpaqueThreadContext { fn context(&self) -> OpaqueThreadContext {

View File

@ -8,7 +8,6 @@ compile_error!("`arch-std` requires `thread-context`.");
pub use thread::*; pub use thread::*;
#[cfg(feature = "executor-thread")] #[cfg(feature = "executor-thread")]
mod thread { mod thread {
use std::marker::PhantomData;
use std::sync::{Condvar, Mutex}; use std::sync::{Condvar, Mutex};
#[cfg(feature = "nightly")] #[cfg(feature = "nightly")]
@ -20,16 +19,13 @@ mod thread {
/// TODO /// TODO
// Name pending // Name pending
pub struct StdThreadCtx { pub struct StdThreadCtx {
_not_send: PhantomData<*mut ()>,
signaler: &'static Signaler, signaler: &'static Signaler,
} }
impl Default for StdThreadCtx { impl Default for StdThreadCtx {
fn default() -> Self { fn default() -> Self {
let signaler = &*Box::leak(Box::new(Signaler::new()));
Self { Self {
_not_send: PhantomData, signaler: &*Box::leak(Box::new(Signaler::new())),
signaler,
} }
} }
} }

View File

@ -27,15 +27,8 @@ mod thread {
/// TODO /// TODO
// Name pending // Name pending
pub struct XtensaThreadContext { #[derive(Default)] // Default enables Executor::new
_not_send: PhantomData<*mut ()>, pub struct XtensaThreadContext;
}
impl Default for XtensaThreadContext {
fn default() -> Self {
Self { _not_send: PhantomData }
}
}
impl ThreadContext for XtensaThreadContext { impl ThreadContext for XtensaThreadContext {
fn context(&self) -> OpaqueThreadContext { fn context(&self) -> OpaqueThreadContext {