pub struct Condvar { /* private fields */ }
Expand description
Mock implementation of std::sync::Condvar
.
Implementations§
source§impl Condvar
impl Condvar
sourcepub fn new() -> Condvar
pub fn new() -> Condvar
Creates a new condition variable which is ready to be waited on and notified.
sourcepub fn wait<'a, T>(
&self,
guard: MutexGuard<'a, T>
) -> LockResult<MutexGuard<'a, T>>
pub fn wait<'a, T>( &self, guard: MutexGuard<'a, T> ) -> LockResult<MutexGuard<'a, T>>
Blocks the current thread until this condition variable receives a notification.
sourcepub fn wait_timeout<'a, T>(
&self,
guard: MutexGuard<'a, T>,
_dur: Duration
) -> LockResult<(MutexGuard<'a, T>, WaitTimeoutResult)>
pub fn wait_timeout<'a, T>( &self, guard: MutexGuard<'a, T>, _dur: Duration ) -> LockResult<(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)
Wakes up one blocked thread on this condvar.
sourcepub fn notify_all(&self)
pub fn notify_all(&self)
Wakes up all blocked threads on this condvar.
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 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