Trait embedded_svc::utils::mutex::RawCondvar
source · pub trait RawCondvar {
type RawMutex: RawMutex;
// Required methods
fn new() -> Self;
unsafe fn wait(&self, mutex: &Self::RawMutex);
unsafe fn wait_timeout(
&self,
mutex: &Self::RawMutex,
duration: Duration
) -> bool;
fn notify_one(&self);
fn notify_all(&self);
}Expand description
A raw Condvar trait for no_std environments. Prevents the introduction of dependency on STD for the utils module and its sub-modules.
NOTE: Users are strongly advised to just depend on STD and use the STD Condvar in their code.
Required Associated Types§
Required Methods§
fn new() -> Self
sourceunsafe fn wait(&self, mutex: &Self::RawMutex)
unsafe fn wait(&self, mutex: &Self::RawMutex)
Safety
- This method should be called only when the mutex is already locked, and by the entity which locked the mutex
sourceunsafe fn wait_timeout(
&self,
mutex: &Self::RawMutex,
duration: Duration
) -> bool
unsafe fn wait_timeout( &self, mutex: &Self::RawMutex, duration: Duration ) -> bool
Safety
- This method should be called only when the mutex is already locked, and by the entity which locked the mutex
fn notify_one(&self)
fn notify_all(&self)
Object Safety§
This trait is not object safe.