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
CYIAutoMutex
CYIAutoReadMutex
CYIAutoSpinlock
CYIMutex
CYIReadWriteMutex
CYISpinlock

#include <thread/YiAutoWriteMutex.h>

Public Member Functions

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

Constructor & Destructor Documentation

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

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

Member Function Documentation

bool CYIAutoWriteMutex::Relock ( )
inline

Relocks a manually unlocked CYIAutoWriteMutex.

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: