Fix Default for rtic_sync::signal

This commit is contained in:
Emil Fresk 2024-06-23 07:54:10 +02:00
parent 8871c85022
commit 07b460fc0f

View file

@ -12,12 +12,17 @@ enum Store<T> {
} }
/// A "latest only" value store with unlimited writers and async waiting. /// A "latest only" value store with unlimited writers and async waiting.
#[derive(Default)]
pub struct Signal<T: Copy> { pub struct Signal<T: Copy> {
waker: CriticalSectionWakerRegistration, waker: CriticalSectionWakerRegistration,
store: UnsafeCell<Store<T>>, store: UnsafeCell<Store<T>>,
} }
impl<T: Copy> Default for Signal<T> {
fn default() -> Self {
Self::new()
}
}
unsafe impl<T: Copy> Send for Signal<T> {} unsafe impl<T: Copy> Send for Signal<T> {}
unsafe impl<T: Copy> Sync for Signal<T> {} unsafe impl<T: Copy> Sync for Signal<T> {}