Pigweed
C/C++ API Reference
|
Public Member Functions | |
constexpr | WakerQueueBase (InlineQueue< Waker > &queue) |
size_t | size () const |
Returns the number of wakers in the queue. | |
bool | empty () const |
Returns true if there are no wakers in the queue. | |
bool | full () const |
Returns true if the queue has no remaining space. | |
void | WakeOne () |
Wakes the first Waker in the queue. | |
void | WakeMany (size_t count) |
Wakes count Wakers from the front of the queue. | |
void | WakeAll () |
Wakes every Waker in the queue. | |
bool | Add (Waker &&waker) |
bool pw::async2::internal::WakerQueueBase::Add | ( | Waker && | waker | ) |
Adds a waker to the end of the queue if there is space. Returns true
if the waker was added, or false
if the queue is full.
NOTE: Prefer using PW_ASYNC_STORE_WAKER
instead of this API directly as it supports specifying a wait reason.