pub struct Condvar { /* private fields */ }
Expand description
A Condition Variable
Lightweight wrappers for Zephyr’s k_condvar
.
Implementations§
source§impl Condvar
impl Condvar
sourcepub fn new() -> Result<Condvar>
pub fn new() -> Result<Condvar>
Create a new Condvar.
Create a new dynamically allocated Condvar. The Condvar can only be used from system threads.
sourcepub fn wait(&self, lock: &Mutex)
pub fn wait(&self, lock: &Mutex)
Wait for someone else using this mutex/condvar pair to notify.
Note that this requires the lock to be held by use, but as this is a low-level binding to
Zephyr’s interfaces, this is not enforced. See sync::Condvar
for a safer and easier to
use interface.
sourcepub fn notify_one(&self)
pub fn notify_one(&self)
Wake a single thread waiting on this condition variable.
sourcepub fn notify_all(&self)
pub fn notify_all(&self)
Wake all threads waiting on this condition variable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Condvar
impl !RefUnwindSafe for Condvar
impl Unpin for Condvar
impl UnwindSafe for Condvar
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more