struct Waiter {
pointers: Pointers<Waiter>,
waker: UnsafeCell<Option<Waker>>,
notification: AtomicNotification,
_p: PhantomPinned,
}
Fields§
§pointers: Pointers<Waiter>
Intrusive linked-list pointers.
waker: UnsafeCell<Option<Waker>>
Waiting task’s waker. Depending on the value of notification
,
this field is either protected by the waiters
lock in
Notify
, or it is exclusively owned by the enclosing Waiter
.
notification: AtomicNotification
Notification for this waiter. Uses 2 bits to store if and how was notified, 1 bit for storing if it was woken up using FIFO or LIFO, and the rest of it is unused.
- if it’s
None
, thenwaker
is protected by thewaiters
lock. - if it’s
Some
, thenwaker
is exclusively owned by the enclosingWaiter
and can be accessed without locking.
_p: PhantomPinned
Should not be Unpin
.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Waiter
impl !RefUnwindSafe for Waiter
impl Send for Waiter
impl !Sync for Waiter
impl !Unpin for Waiter
impl !UnwindSafe for Waiter
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