You.i Engine
CYIAutoMutex Class Reference

Detailed Description

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

See also
CYIAutoSpinLock
CYIAutoReadMutex
CYIAutoWriteMutex
CYIMutex
CYIReadWriteMutex
CYISpinLock

#include <thread/YiAutoMutex.h>

Public Member Functions

 CYIAutoMutex (CYIMutex &rMutex)
 
 ~CYIAutoMutex ()
 
bool Relock ()
 
bool Unlock ()
 

Constructor & Destructor Documentation

CYIAutoMutex::CYIAutoMutex ( CYIMutex rMutex)
inline

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

CYIAutoMutex::~CYIAutoMutex ( )
inline

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

Member Function Documentation

bool CYIAutoMutex::Relock ( )
inline

Relocks a manually unlocked CYIAutoMutex.

bool CYIAutoMutex::Unlock ( )
inline

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


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