pub struct CondVar { /* private fields */ }Expand description
A condition variable, for more complex synchronization with a Mutex.
Implementations§
Source§impl CondVar
impl CondVar
Sourcepub fn broadcast(&self) -> Result<()>
pub fn broadcast(&self) -> Result<()>
Broadcasts the condition variable, waking up all waiting tasks.
Sourcepub fn wait(&self, _guard: MutexGuard<'_>) -> Result<()>
pub fn wait(&self, _guard: MutexGuard<'_>) -> Result<()>
Waits for the condition variable to be signaled.
Note: OSAL condition variables have their own internal mutex
(OS_CondVarLock/OS_CondVarUnlock). The _guard param
here is consumed to enforce discipline, but the underlying
OSAL wait operates on the condvar’s internal mutex, not the
external one.
Sourcepub fn timed_wait(&self, _guard: MutexGuard<'_>, abstime: OsTime) -> Result<()>
pub fn timed_wait(&self, _guard: MutexGuard<'_>, abstime: OsTime) -> Result<()>
Atomically unlocks the mutex and waits for the condition variable, with a timeout.
Sourcepub fn get_id_by_name(name: &str) -> Result<OsalId>
pub fn get_id_by_name(name: &str) -> Result<OsalId>
Finds an existing condition variable ID by its name.
Sourcepub fn get_info(&self) -> Result<CondVarProp>
pub fn get_info(&self) -> Result<CondVarProp>
Retrieves information about this condition variable.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CondVar
impl RefUnwindSafe for CondVar
impl Send for CondVar
impl Sync for CondVar
impl Unpin for CondVar
impl UnsafeUnpin 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