#include <winmutex.h>
Windows implementation of IConditionMutex using WinApi Condition Variables. https://msdn.microsoft.com/en-us/library/windows/desktop/ms682052(v=vs.85).aspx. Windows Server 2003 / XP and below aren't supported.
◆ WinConditionMutex()
| ttv::WinConditionMutex::WinConditionMutex |
( |
| ) |
|
◆ ~WinConditionMutex()
| virtual ttv::WinConditionMutex::~WinConditionMutex |
( |
| ) |
|
|
virtual |
◆ Broadcast()
◆ Destroy()
◆ Lock()
Block/wait until the mutex is free to take, and then acquire the mutex.
- Returns
- TTV_EC_SUCCESS: Mutex has been successfully acquired.
Implements ttv::IMutex.
◆ Signal()
◆ TryLock()
Attempt to acquire the mutex, without waiting for the lock to be available.
- Returns
- TTV_EC_SUCCESS: Mutex has been successfully acquired.
- TTV_WRN_MUTEX_NOT_ACQUIRED: Lock has failed and mutex has not been acquired.
Implements ttv::IMutex.
◆ Unlock()
Release the previously acquired mutex (through Lock()).
- Returns
- TTV_EC_SUCCESS: Mutex has been sucessfully released.
Implements ttv::IMutex.
◆ Wait()
◆ WaitFor()
| virtual TTV_ErrorCode ttv::WinConditionMutex::WaitFor |
( |
uint64_t |
timeoutMilliseconds | ) |
|
|
overridevirtual |
Wait on the IConditionMutex until notified to wake up OR the timeout is reached.
- Parameters
-
| [in] | timeoutMilliseconds | The timeout to wait in milliseconds. |
- Returns
- TTV_EC_SUCCESS: Waited sucessfully on the IConditionMutex (and was notified through Signal()/Broadcast()).
- TTV_WRN_WAIT_TIMEOUT: The timeout was hit while waiitng on IConditionMutex.
- TTV_WRN_CONDITION_WAIT_FAILED: Wait was not successful.
Implements ttv::IConditionMutex.
◆ mConditionVariable
| CONDITION_VARIABLE ttv::WinConditionMutex::mConditionVariable |
|
private |
◆ mCriticalSection
| CRITICAL_SECTION ttv::WinConditionMutex::mCriticalSection |
|
private |
◆ mLocked
| bool ttv::WinConditionMutex::mLocked |
|
private |
The documentation for this class was generated from the following file:
- modules/core/core_win32/include/twitchsdk/core/winmutex.h