Twitch SDK (Internal)
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ttv::WinMutex Class Reference

#include <winmutex.h>

Inheritance diagram for ttv::WinMutex:
ttv::IMutex

Public Member Functions

 WinMutex ()
 
virtual ~WinMutex ()
 
virtual TTV_ErrorCode Lock () override
 
virtual TTV_ErrorCode TryLock () override
 
virtual TTV_ErrorCode Unlock () override
 

Private Member Functions

TTV_ErrorCode Destroy ()
 

Private Attributes

CRITICAL_SECTION mCriticalSection
 
bool mLocked
 

Detailed Description

Windows implementation of IMutex using WinApi Critical Section. https://msdn.microsoft.com/en-us/library/windows/desktop/ms682530(v=vs.85).aspx. Windows Server 2003 / XP and below aren't supported.

Constructor & Destructor Documentation

◆ WinMutex()

ttv::WinMutex::WinMutex ( )

◆ ~WinMutex()

virtual ttv::WinMutex::~WinMutex ( )
virtual

Member Function Documentation

◆ Destroy()

TTV_ErrorCode ttv::WinMutex::Destroy ( )
private

◆ Lock()

virtual TTV_ErrorCode ttv::WinMutex::Lock ( )
overridevirtual

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.

◆ TryLock()

virtual TTV_ErrorCode ttv::WinMutex::TryLock ( )
overridevirtual

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()

virtual TTV_ErrorCode ttv::WinMutex::Unlock ( )
overridevirtual

Release the previously acquired mutex (through Lock()).

Returns
  • TTV_EC_SUCCESS: Mutex has been sucessfully released.

Implements ttv::IMutex.

Member Data Documentation

◆ mCriticalSection

CRITICAL_SECTION ttv::WinMutex::mCriticalSection
private

◆ mLocked

bool ttv::WinMutex::mLocked
private

The documentation for this class was generated from the following file: