class Signal

Similar to std::condition_variable, but also works with fibers in a way that allows waiting fibers to yield rather than blocking the thread.

Public

Constructors

Signal

Signal() noexcept(false) = default

Methods

NotifyOne

inline void NotifyOne()

Notifies one waiting fiber or thread.

NotifyAll

inline void NotifyAll()

Notifies all waiting fibers and threads.

Private

Fields

mMutex

Mutex mMutex

mWaitingFibers

List<Fiber *> mWaitingFibers

mCondition

std::condition_variable mCondition

mTotalWaitingCount

std::atomic<int> mTotalWaitingCount

mThreadWaitingCount

std::atomic<int> mThreadWaitingCount