diff options
Diffstat (limited to 'CPP/Windows/Synchronization.cpp')
| -rw-r--r-- | CPP/Windows/Synchronization.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/CPP/Windows/Synchronization.cpp b/CPP/Windows/Synchronization.cpp index fbf919d..d5542af 100644 --- a/CPP/Windows/Synchronization.cpp +++ b/CPP/Windows/Synchronization.cpp | |||
| @@ -19,6 +19,30 @@ namespace NSynchronization { | |||
| 19 | DWORD WaitForMultipleObjects(DWORD count, const HANDLE *handles, BOOL wait_all, DWORD timeout); | 19 | DWORD WaitForMultipleObjects(DWORD count, const HANDLE *handles, BOOL wait_all, DWORD timeout); |
| 20 | */ | 20 | */ |
| 21 | 21 | ||
| 22 | /* clang: we need to place some virtual functions in cpp file to rid off the warning: | ||
| 23 | 'CBaseHandle_WFMO' has no out-of-line virtual method definitions; | ||
| 24 | its vtable will be emitted in every translation unit */ | ||
| 25 | CBaseHandle_WFMO::~CBaseHandle_WFMO() | ||
| 26 | { | ||
| 27 | } | ||
| 28 | |||
| 29 | bool CBaseEvent_WFMO::IsSignaledAndUpdate() | ||
| 30 | { | ||
| 31 | if (this->_state == false) | ||
| 32 | return false; | ||
| 33 | if (this->_manual_reset == false) | ||
| 34 | this->_state = false; | ||
| 35 | return true; | ||
| 36 | } | ||
| 37 | |||
| 38 | bool CSemaphore_WFMO::IsSignaledAndUpdate() | ||
| 39 | { | ||
| 40 | if (this->_count == 0) | ||
| 41 | return false; | ||
| 42 | this->_count--; | ||
| 43 | return true; | ||
| 44 | } | ||
| 45 | |||
| 22 | DWORD WINAPI WaitForMultiObj_Any_Infinite(DWORD count, const CHandle_WFMO *handles) | 46 | DWORD WINAPI WaitForMultiObj_Any_Infinite(DWORD count, const CHandle_WFMO *handles) |
| 23 | { | 47 | { |
| 24 | if (count < 1) | 48 | if (count < 1) |
