mirror of
https://github.com/embassy-rs/embassy.git
synced 2024-11-25 16:23:10 +00:00
Make Executor non-Send to close run() safety hole.
This commit is contained in:
parent
9dea5035b9
commit
76196c424a
@ -1,6 +1,7 @@
|
|||||||
use core::cell::Cell;
|
use core::cell::Cell;
|
||||||
use core::cell::UnsafeCell;
|
use core::cell::UnsafeCell;
|
||||||
use core::future::Future;
|
use core::future::Future;
|
||||||
|
use core::marker::PhantomData;
|
||||||
use core::mem;
|
use core::mem;
|
||||||
use core::mem::MaybeUninit;
|
use core::mem::MaybeUninit;
|
||||||
use core::pin::Pin;
|
use core::pin::Pin;
|
||||||
@ -241,6 +242,7 @@ impl Drop for SpawnToken {
|
|||||||
pub struct Executor {
|
pub struct Executor {
|
||||||
queue: Queue,
|
queue: Queue,
|
||||||
signal_fn: fn(),
|
signal_fn: fn(),
|
||||||
|
not_send: PhantomData<*mut ()>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Executor {
|
impl Executor {
|
||||||
@ -248,6 +250,7 @@ impl Executor {
|
|||||||
Self {
|
Self {
|
||||||
queue: Queue::new(),
|
queue: Queue::new(),
|
||||||
signal_fn: signal_fn,
|
signal_fn: signal_fn,
|
||||||
|
not_send: PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user