TimedCondition
TimedCondition

Class that acts as a simple wrapper around a std::condition_variable.  Used for one process waiting on a certain condition to be met or a timeout, in which case the other process is notified of the action.

Functions
TimedCondition
TimedCondition()

Creates a TimedCondition object

Variables
m_condition
std::condition_variable m_condition

The condition object that this class provides a wrapper for.

m_mutex
std::mutex m_mutex

The mutex to handle thread-safe access

m_isNotified
bool m_isNotified

Whether or not the condition has been notified

Functions
timedWait
bool timedWait(
uint64 timeout
)

Blocks until the condition is met by calling notify() or until the timeout has expired.  Also returns true immediately if the condition has already been notified.

Parameters
timeout
uint64

The timeout (in milliseconds) to set for the condition.

Returns

true if the condition was met from a call to notify(). false if the timeout has expired.

notify
void notify()

Unblocks the TimedCondition if it is currently blocked from calling timedWait()