pub struct CondVar { /* private fields */ }Expand description
Condition variable.
Implementations§
Source§impl CondVar
impl CondVar
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new condition variable via heap allocation (only in heap mode).
Sourcepub fn wait(&self, mutex: &Mutex, timeout_ms: u32) -> Result<()>
pub fn wait(&self, mutex: &Mutex, timeout_ms: u32) -> Result<()>
Atomically release mutex and block until signalled or timeout_ms elapses.
On return (successful or not), mutex is re-acquired before this function returns.
§Errors
Returns Error::Timeout if neither signal nor
broadcast fires within timeout_ms.
Trait Implementations§
impl Send for CondVar
impl Sync for CondVar
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