AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
ACutoffSignal Class Reference

One-shot event communication. More...

#include <AUI/Thread/ACutoffSignal.h>

Public Member Functions#

void makeSignal ()
 Flags a signal, causing the waitForSignal() to never block.
 
void resetSignal () noexcept
 Resets the cut off state so the waitForSignal() function would block again.
 
void waitForSignal ()
 Wait for makeSignal().
 

Detailed Description#

Used for guaranteed signal from slave thread to master thread (i.e. wait till slave thread starts).

Member Function Documentation#

◆ waitForSignal()#

void ACutoffSignal::waitForSignal ( )
inline

waitForSignal() blocks the thread until makeSignal() is not called by other thread.

Unlike condition variable, the second call to makeSignal() will not block. To override this behaviour, use the resetSignal() function.