diff options
| author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-06-21 00:00:00 +0000 |
|---|---|---|
| committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2023-12-17 14:59:19 +0500 |
| commit | 5b39dc76f1bc82f941d5c800ab9f34407a06b53a (patch) | |
| tree | fe5e17420300b715021a76328444088d32047963 /CPP/Windows/Synchronization.cpp | |
| parent | 93be7d4abfd4233228f58ee1fbbcd76d91be66a4 (diff) | |
| download | 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.gz 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.tar.bz2 7zip-5b39dc76f1bc82f941d5c800ab9f34407a06b53a.zip | |
23.0123.01
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) |
