17 INLINE ConditionVarWin32Impl::
18 ConditionVarWin32Impl(MutexWin32Impl &mutex) {
19 _external_mutex = &mutex._lock;
22 _event_signal = CreateEvent(
nullptr,
false,
false,
nullptr);
28 INLINE ConditionVarWin32Impl::
29 ~ConditionVarWin32Impl() {
30 CloseHandle(_event_signal);
36 INLINE
void ConditionVarWin32Impl::
38 LeaveCriticalSection(_external_mutex);
40 DWORD result = WaitForSingleObject(_event_signal, INFINITE);
41 nassertv(result == WAIT_OBJECT_0);
43 EnterCriticalSection(_external_mutex);
49 INLINE
void ConditionVarWin32Impl::
50 wait(
double timeout) {
51 LeaveCriticalSection(_external_mutex);
53 DWORD result = WaitForSingleObject(_event_signal, (DWORD)(timeout * 1000.0));
54 nassertv(result == WAIT_OBJECT_0 || result == WAIT_TIMEOUT);
56 EnterCriticalSection(_external_mutex);
62 INLINE
void ConditionVarWin32Impl::
64 SetEvent(_event_signal);