diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2013-01-08 22:23:30 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:48:23 +0300 |
commit | d1a56619aeff97c1302a9f2d0f0c0391966a3e44 (patch) | |
tree | f244ab1f45381f0381f0e675fea74df028248aba /base | |
parent | 1cbe46b04ae7d2c70f21c95203a02a7dbf29f953 (diff) |
implemented Condition for Win32.
Diffstat (limited to 'base')
-rw-r--r-- | base/condition_windows_native.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/base/condition_windows_native.cpp b/base/condition_windows_native.cpp index abd467cea7..c72ccfbd4c 100644 --- a/base/condition_windows_native.cpp +++ b/base/condition_windows_native.cpp @@ -51,10 +51,9 @@ namespace threads m_pWake(&m_Condition); } - void Wait() + void Wait(unsigned ms) { - /// TODO: Use MS parameter. - m_pSleep(&m_Condition, &m_mutex.m_Mutex, INFINITE); + m_pSleep(&m_Condition, &m_mutex.m_Mutex, ms); } void Lock() @@ -158,10 +157,8 @@ namespace threads } } - void Wait() + void Wait(unsigned ms) { - // TODO : Use MS parameter. - // Avoid race conditions ::EnterCriticalSection(&waiters_count_lock_); ++waiters_count_; @@ -170,7 +167,7 @@ namespace threads // This call atomically releases the mutex and waits on the // semaphore until <pthread_cond_signal> or <pthread_cond_broadcast> // are called by another thread - ::SignalObjectAndWait(m_mutex, sema_, INFINITE, FALSE); + ::SignalObjectAndWait(m_mutex, sema_, ms, FALSE); // Reacquire lock to avoid race conditions ::EnterCriticalSection(&waiters_count_lock_); |