25 #ifndef COMMON_UTILS_LATCH_HPP
26 #define COMMON_UTILS_LATCH_HPP
29 #include <condition_variable>
61 bool wait(
const unsigned int timeoutMs);
77 bool waitForN(
const unsigned int n,
const unsigned int timeoutMs);
93 #endif // COMMON_UTILS_LATCH_HPP
std::condition_variable mCondition
Definition: latch.hpp:85
A synchronization aid that allows one thread to wait until an operation being performed in other thre...
Definition: latch.hpp:41
void set()
Sets an event occurred.
Definition: latch.cpp:39
bool empty()
Check if there are no pending events.
Definition: latch.cpp:75
Latch()
Definition: latch.cpp:34
std::mutex mMutex
Definition: latch.hpp:84
unsigned int mCount
Definition: latch.hpp:86
void wait()
Waits for a single occurrence of event.
Definition: latch.cpp:46
void waitForN(const unsigned int n)
Waits for occurrences of event.
Definition: latch.cpp:56