SpiecsEngine
 
Loading...
Searching...
No Matches

◆ Wait()

void Spices::semaphore::Wait ( int sign)
inline

Wait this semaphore until it owns equal sign with given.

Parameters
[in]sign.

Definition at line 57 of file Semaphore.h.

58 {
59 if (m_Sign.load() != sign)
60 {
61 std::unique_lock<std::mutex> lock(m_Mutex);
62
63 m_Cond.wait(lock, [&]() { return m_Sign.load() == sign; });
64 }
65 }
std::mutex m_Mutex
Mutex of this semaphore.
Definition Semaphore.h:82
std::atomic_int m_Sign
Sign of this semaphore.
Definition Semaphore.h:77
std::condition_variable m_Cond
condition variable of this semaphore.
Definition Semaphore.h:87

Referenced by SpicesTest::TEST().