pub struct WaitFuture<'a> { /* private fields */ }
Expand description
A future representing a thread that is waiting for a notification from
another thread using a HybridFutex
synchronization primitive.
Trait Implementations§
Source§impl<'a> Debug for WaitFuture<'a>
impl<'a> Debug for WaitFuture<'a>
Source§impl<'a> Drop for WaitFuture<'a>
impl<'a> Drop for WaitFuture<'a>
Source§impl<'a> Future for WaitFuture<'a>
impl<'a> Future for WaitFuture<'a>
Source§fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()>
Polls the future, returning Poll::Pending
if the future is still waiting
for a notification, and Poll::Ready(())
if the future has been notified.
If the future has not yet been polled, this method increments the counter
of the HybridFutex
that the future is waiting on to indicate that the
current thread is waiting. If the counter is already negative, the future
immediately resolves and returns Poll::Ready(())
. Otherwise, the method
pushes a new AsyncWaiter
onto the queue of waiters for the HybridFutex
,
and returns Poll::Pending
.
If the future has already been polled and the value of the state
field is
1
, this method simply returns Poll::Pending
without modifying the state
or the queue of waiters.
If the future has already been notified and the value of the state
field
is !0
, this method returns Poll::Ready(())
without modifying the state
or the queue of waiters.