Struct WaitQueue
pub struct WaitQueue { /* private fields */ }Available on crate feature
threading only.Expand description
An WaitQueue, allowing threads to wait for or be notified by other threads.
Similar to [Event], but without any state.
Implementations§
§impl WaitQueue
impl WaitQueue
pub fn wait(&self)
pub fn wait(&self)
pub fn wait_until(&self, deadline: Instant) -> bool
pub fn wait_until(&self, deadline: Instant) -> bool
pub fn wait_until_with_check(
&self,
deadline: Instant,
check: impl Fn(CriticalSection<'_>) -> bool,
) -> bool
pub fn wait_until_with_check( &self, deadline: Instant, check: impl Fn(CriticalSection<'_>) -> bool, ) -> bool
Waits for this WaitQueue to be notified, with deadline and check fn (blocking).
This function:
- calls
check() - if
check()has returned true, returns true - else, waits on
Selfuntildeadline(or notification) - calls
check()again, returns its result
§Panics
Panics if this is called outside of a thread context.
pub fn notify_all(&self)
pub fn notify_all(&self)
Notify all waiters.
pub fn notify_one(&self)
pub fn notify_one(&self)
Notify one waiter.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for WaitQueue
impl !RefUnwindSafe for WaitQueue
impl Send for WaitQueue
impl Unpin for WaitQueue
impl UnwindSafe for WaitQueue
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