#include <QThread.h>
QMtxHold simply takes a FX::QMutex, FX::QRWMutex or FX::QShrdMemMutex (or pointers to the same) as an argument to its constructor and locks the mutex for you. Hence then when QMtxHold is destructed, the mutex is guaranteed to be freed.
A rarely used other possibility is to pass QMtxHold::UnlockAndRelock as the second argument to the constructor - this unlocks the mutex and relocks it on destruction.
Definition at line 522 of file QThread.h.
Public Types | |
LockAndUnlock | |
UnlockAndRelock | |
AcceptNullMutex | |
IsShrdMutex | |
IsRWMutex | |
IsLocked | |
IsRWMutexWrite | |
enum | Flags { LockAndUnlock, UnlockAndRelock, AcceptNullMutex, IsShrdMutex, IsRWMutex, IsLocked, IsRWMutexWrite } |
Public Member Functions | |
FXFORCEINLINE | QMtxHold (const QMutex *m, FXuint _flags=LockAndUnlock) |
FXFORCEINLINE | QMtxHold (const QMutex &m, FXuint _flags=LockAndUnlock) |
FXFORCEINLINE | QMtxHold (const QRWMutex *m, bool write=true, FXuint _flags=LockAndUnlock) |
FXFORCEINLINE | QMtxHold (const QRWMutex &m, bool write=true, FXuint _flags=LockAndUnlock) |
FXFORCEINLINE | QMtxHold (const QShrdMemMutex *m, FXuint _flags=LockAndUnlock) |
FXFORCEINLINE | QMtxHold (const QShrdMemMutex &m, FXuint _flags=LockAndUnlock) |
FXFORCEINLINE void | unlock () |
FXFORCEINLINE void | relock () |
FXFORCEINLINE bool | lockLost () const |
FXFORCEINLINE | ~QMtxHold () |