Move WaitableEvent

This commit is contained in:
Vinnie Falco
2013-10-04 11:12:16 -07:00
parent ff305e63b6
commit c864e4d3db
10 changed files with 209 additions and 125 deletions

View File

@@ -72,21 +72,6 @@ void CriticalSection::enter() const noexcept { EnterCriticalSection ((CRITICAL_S
bool CriticalSection::tryEnter() const noexcept { return TryEnterCriticalSection ((CRITICAL_SECTION*) section) != FALSE; }
void CriticalSection::exit() const noexcept { LeaveCriticalSection ((CRITICAL_SECTION*) section); }
//==============================================================================
WaitableEvent::WaitableEvent (const bool manualReset, bool initiallySignaled) noexcept
: handle (CreateEvent (0, manualReset ? TRUE : FALSE, initiallySignaled ? TRUE : FALSE, 0)) {}
WaitableEvent::~WaitableEvent() noexcept { CloseHandle (handle); }
void WaitableEvent::signal() const noexcept { SetEvent (handle); }
void WaitableEvent::reset() const noexcept { ResetEvent (handle); }
bool WaitableEvent::wait (const int timeOutMs) const noexcept
{
return WaitForSingleObject (handle, (DWORD) timeOutMs) == WAIT_OBJECT_0;
}
//==============================================================================
void BEAST_API beast_threadEntryPoint (void*);