From 33fc1474d90ea68df862e5a5c15980a11961bf16 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 22 Jun 2015 21:27:13 +0100 Subject: Fixed minor errors in Tycho's code Everything should work now :) --- src/OSSupport/Event.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/OSSupport/Event.h') diff --git a/src/OSSupport/Event.h b/src/OSSupport/Event.h index 572388a3f..2c58ba485 100644 --- a/src/OSSupport/Event.h +++ b/src/OSSupport/Event.h @@ -12,6 +12,7 @@ #include #include +#include @@ -28,7 +29,11 @@ public: /** Sets the event - releases one thread that has been waiting in Wait(). If there was no thread waiting, the next call to Wait() will not block. */ - void Set (void); + void Set(void); + + /** Sets the event - releases all threads that have been waiting in Wait(). + If there was no thread waiting, the next call to Wait() will not block. */ + void SetAll(void); /** Waits for the event until either it is signalled, or the (relative) timeout is passed. Returns true if the event was signalled, false if the timeout was hit or there was an error. */ @@ -37,9 +42,9 @@ public: private: /** Used for checking for spurious wakeups. */ - bool m_ShouldWait; + std::atomic m_ShouldContinue; - /** Mutex protecting m_ShouldWait from multithreaded access. */ + /** Mutex protecting m_ShouldContinue from multithreaded access. */ std::mutex m_Mutex; /** The condition variable used as the Event. */ -- cgit v1.2.3