FX::QMtxHold Class Reference

#include <QThread.h>

List of all members.


Detailed Description

Helper class for using mutexes.

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


The documentation for this class was generated from the following file:
(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:37:45 2009 for TnFOX by doxygen v1.4.7