7#include "Misc/AssertionMacros.h"
11
12
33 const int rc = pthread_mutex_lock(&Mutex);
39 const int rc = pthread_mutex_unlock(&Mutex);
43 static inline void SubtractTimevals(
const struct timeval *FromThis,
struct timeval *SubThis,
struct timeval *Difference )
45 if (FromThis->tv_usec < SubThis->tv_usec)
47 int nsec = (SubThis->tv_usec - FromThis->tv_usec) / 1000000 + 1;
48 SubThis->tv_usec -= 1000000 * nsec;
49 SubThis->tv_sec += nsec;
52 if (FromThis->tv_usec - SubThis->tv_usec > 1000000)
54 int nsec = (FromThis->tv_usec - SubThis->tv_usec) / 1000000;
55 SubThis->tv_usec += 1000000 * nsec;
56 SubThis->tv_sec -= nsec;
59 Difference->tv_sec = FromThis->tv_sec - SubThis->tv_sec;
60 Difference->tv_usec = FromThis->tv_usec - SubThis->tv_usec;
93 pthread_cond_destroy(&Condition);
96 pthread_mutex_destroy(&Mutex);
102 virtual bool Create(
bool _bIsManualReset =
false )
override
104 check(!bInitialized);
109 if (pthread_mutex_init(&Mutex,
nullptr) == 0)
111 if (pthread_cond_init(&Condition,
nullptr) == 0)
118 pthread_mutex_destroy(&Mutex);
141 int rc = pthread_cond_broadcast(&Condition);
149 int rc = pthread_cond_signal(&Condition);
166 virtual bool Wait( uint32 WaitTime = (uint32)-1,
const bool bIgnoreThreadIdleStats =
false )
override;
virtual bool IsManualReset() override
volatile TriggerType Triggered
volatile int32 WaitingThreads
virtual bool Wait(uint32 WaitTime=(uint32) -1, const bool bIgnoreThreadIdleStats=false) override
virtual void Reset() override
virtual bool Create(bool _bIsManualReset=false) override
virtual void Trigger() override