use core::task::Waker;
use super::GenericAtomicWaker;
use crate::blocking_mutex::raw::CriticalSectionRawMutex;
pub struct CriticalSectionWaker {
waker: GenericAtomicWaker<CriticalSectionRawMutex>,
}
impl CriticalSectionWaker {
pub const fn new() -> Self {
Self {
waker: GenericAtomicWaker::new(CriticalSectionRawMutex::new()),
}
}
pub fn register(&self, w: &Waker) {
self.waker.register(w);
}
pub fn wake(&self) {
self.waker.wake();
}
}