mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-23 20:45:51 +00:00
Move WaitableEvent
This commit is contained in:
@@ -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*);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user