|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |
#include "ot/base/FastMutex.h"
Variety of mutex that is optimized and may offer better performance on some platforms.
A mutex can be acquired (locked) by only one thread at a time. A thread should not attempt to acquire a FastMutex that it already owns (see RecursiveMutex if you require this).While a thread 'owns' the mutex (i.e. has it locked), it can safely use the protected resource, which may be a variable, a region of memory or anything else, in the knowledge that no other thread will be accessing it. However, this only holds true if all threads obey the rules and acquire the mutex before attempting to access the protected resource.
Constructor/Destructor Summary | |
FastMutex() Default constructor. | |
~FastMutex() Destructor. |
Method Summary | |
void |
lock() Acquires the mutex. |
bool |
tryLock() Attempts to acquire the mutex without blocking. |
void |
unlock() Releases the mutex. |
Typedefs |
typedef AutoLock< FastMutex > Lock
Constructor/Destructor Detail |
FastMutex()
~FastMutex()
Method Detail |
void lock()
A thread should not attempt to lock a FastMutex that it already owns. This behaviour is undefined for the FastMutex class but is supported by RecursiveMutex.
bool tryLock()
void unlock()
|
OpenTop 1.3 | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | Cross-Platform C++ | ||||
SUMMARY: CONSTRUCTOR | METHOD | DETAIL: CONSTRUCTOR | METHOD |