You.i Engine
CYIAutoWriteMutex Class Reference

Detailed Description

The CYIAutoWriteMutex is a helper class that simplifies the locking and unlocking of read/write mutexes based on the RAII principle. The constructor will perform a write-lock while the destructor automatically perform an unlock.

See also
CYIAutoReadMutex
CYIReadWriteMutex
CYISpinLock
yi::deprecated::CYIAutoSpinLock

#include <thread/YiAutoWriteMutex.h>

Public Member Functions

 CYIAutoWriteMutex (CYIReadWriteMutex &rMutex)
 
 ~CYIAutoWriteMutex ()
 
bool Relock ()
 
bool Unlock ()
 

Constructor & Destructor Documentation

◆ CYIAutoWriteMutex()

CYIAutoWriteMutex::CYIAutoWriteMutex ( CYIReadWriteMutex rMutex)
inline

Constructs a CYIAutoWriteMutex and performs a write-lock on the m_rMutex. The CYIAutoWriteMutex will automatically unlock when the instance is destroyed.

◆ ~CYIAutoWriteMutex()

CYIAutoWriteMutex::~CYIAutoWriteMutex ( )
inline

Destroys the CYIAutoWriteMutex and unlocks m_rMutex that was locked by the constructor.

Member Function Documentation

◆ Relock()

bool CYIAutoWriteMutex::Relock ( )
inline

Relocks a manually unlocked CYIAutoWriteMutex.

◆ Unlock()

bool CYIAutoWriteMutex::Unlock ( )
inline

Unlocks m_rMutex. You may relock the CYIAutoWriteMutex using CYIAutoWriteMutex::Relock().


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