pub struct Condvar {
std: Condvar,
}
Expand description
A Condition Variable.
Fields§
§std: Condvar
Implementations§
source§impl Condvar
impl Condvar
sourcepub fn wait<'a, T>(&self, guard: MutexGuard<'a, T>) -> MutexGuard<'a, T>
pub fn wait<'a, T>(&self, guard: MutexGuard<'a, T>) -> MutexGuard<'a, T>
Waits on a condvar, blocking the current thread until it is notified.
sourcepub fn wait_while<'a, T, F>(
&self,
guard: MutexGuard<'a, T>,
condition: F
) -> MutexGuard<'a, T>
pub fn wait_while<'a, T, F>( &self, guard: MutexGuard<'a, T>, condition: F ) -> MutexGuard<'a, T>
Blocks the current thread until this condition variable receives a notification and the provided condition is false.
sourcepub fn wait_timeout<'a, T>(
&self,
guard: MutexGuard<'a, T>,
dur: Duration
) -> (MutexGuard<'a, T>, WaitTimeoutResult)
pub fn wait_timeout<'a, T>( &self, guard: MutexGuard<'a, T>, dur: Duration ) -> (MutexGuard<'a, T>, WaitTimeoutResult)
Waits on a condvar, blocking the current thread until it is notified or the specified duration has elapsed.
sourcepub fn wait_timeout_while<'a, T, F>(
&self,
guard: MutexGuard<'a, T>,
dur: Duration,
condition: F
) -> (MutexGuard<'a, T>, WaitTimeoutResult)
pub fn wait_timeout_while<'a, T, F>( &self, guard: MutexGuard<'a, T>, dur: Duration, condition: F ) -> (MutexGuard<'a, T>, WaitTimeoutResult)
Waits on this condition variable for a notification, timing out after a specified duration.
sourcepub fn notify_one(&self)
pub fn notify_one(&self)
Notifies one thread blocked by this condvar.
sourcepub fn notify_all(&self)
pub fn notify_all(&self)
Notifies all threads blocked by this condvar.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Condvar
impl Send for Condvar
impl Sync 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