pub struct Condvar { /* private fields */ }Expand description
A condition variable: wait for a change another thread makes under a Mutex.
Implementations§
Source§impl Condvar
impl Condvar
pub const fn new() -> Condvar
Sourcepub fn wait<'a, T: ?Sized>(&self, guard: MutexGuard<'a, T>) -> MutexGuard<'a, T>
pub fn wait<'a, T: ?Sized>(&self, guard: MutexGuard<'a, T>) -> MutexGuard<'a, T>
Unlock, wait for a notify, lock again.
Sourcepub fn wait_timeout<'a, T: ?Sized>(
&self,
guard: MutexGuard<'a, T>,
d: Duration,
) -> (MutexGuard<'a, T>, WaitTimeoutResult)
pub fn wait_timeout<'a, T: ?Sized>( &self, guard: MutexGuard<'a, T>, d: Duration, ) -> (MutexGuard<'a, T>, WaitTimeoutResult)
wait with a timeout in frame time.
Sourcepub fn wait_while<'a, T: ?Sized>(
&self,
guard: MutexGuard<'a, T>,
condition: impl FnMut(&mut T) -> bool,
) -> MutexGuard<'a, T>
pub fn wait_while<'a, T: ?Sized>( &self, guard: MutexGuard<'a, T>, condition: impl FnMut(&mut T) -> bool, ) -> MutexGuard<'a, T>
Wait while condition holds.
pub fn notify_one(&self)
pub fn notify_all(&self)
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