10#include "AsyncManualResetEvent.hpp"
48 if(
mCount.fetch_sub(
n, std::memory_order_acq_rel) <=
n) {
59 auto operator co_await()
const noexcept {
return mEvent.operator
co_await(); }
Definition AsyncLatch.hpp:19
bool is_ready() const noexcept
Query if the latch has become signalled.
Definition AsyncLatch.hpp:33
Atomic< std::ptrdiff_t > mCount
Definition AsyncLatch.hpp:62
AsyncLatch(std::ptrdiff_t initialCount) noexcept
Construct the latch with the specified initial count.
Definition AsyncLatch.hpp:28
AsyncManualResetEvent mEvent
Definition AsyncLatch.hpp:63
void count_down(std::ptrdiff_t n=1) noexcept
Decrement the count by n.
Definition AsyncLatch.hpp:47
An async manual-reset event is a coroutine synchronisation abstraction that allows one or more corout...
Definition AsyncEvent.hpp:27
void set() noexcept
Set the state of the event to 'set'.
Definition Application.hpp:19
std::atomic< T > Atomic
The Atomic template defines an atomic type.
Definition Atomic.hpp:16
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25