OGRE-Next
4.0.0unstable
Object-Oriented Graphics Rendering Engine
|
A lightweight mutex is a synchronization mechanism, very similar to a regular mutex. More...
#include <OgreLightweightMutex.h>
Public Member Functions | |
LightweightMutex () | |
~LightweightMutex () | |
void | lock () |
Acquires the exclusive lock. More... | |
bool | tryLock () |
Tries to aquire the lock and returns immediately. More... | |
void | unlock () |
Releases the lock aquired through either. More... | |
A lightweight mutex is a synchronization mechanism, very similar to a regular mutex.
Regular mutexes are well known to be expensive because they need to enter & leave kernel mode.
Ogre::LightweightMutex::LightweightMutex | ( | ) |
Ogre::LightweightMutex::~LightweightMutex | ( | ) |
void Ogre::LightweightMutex::lock | ( | ) |
Acquires the exclusive lock.
Waits if necessary until another thread releases the lock. Recursive locking is not guaranteed (do not call this function twice from the same thread)
bool Ogre::LightweightMutex::tryLock | ( | ) |
Tries to aquire the lock and returns immediately.
On failure returns false, true on success
void Ogre::LightweightMutex::unlock | ( | ) |