Public Member Functions | Protected Attributes

Threads::Mutex Class Reference

Is a lock that allows a thread to have exlusive rights to something. More...

Inheritance diagram for Threads::Mutex:
Threads::ConditionVar

List of all members.

Public Member Functions

 Mutex (bool recursive=false)
 Mutex (const Mutex &)
virtual ~Mutex ()
void lock ()
void unLock ()
bool tryLock ()

Protected Attributes

QMutex * qmutex_

Detailed Description

Is a lock that allows a thread to have exlusive rights to something.

It is guaranteed that once locked, noone else will be able to lock it before it is unlocked. If a thread tries to lock it, it will be postponed until the thread that has locked it will unlock it.


Constructor & Destructor Documentation

Threads::Mutex::Mutex ( bool  recursive = false  ) 
Threads::Mutex::Mutex ( const Mutex  ) 
virtual Threads::Mutex::~Mutex (  )  [virtual]

Member Function Documentation

void Threads::Mutex::lock (  ) 
bool Threads::Mutex::tryLock (  ) 

Returns true if mutex is locked. If it is locked, it you must unLock it when you are finished. If it returns false, carry on with your life.

void Threads::Mutex::unLock (  ) 

Member Data Documentation

QMutex* Threads::Mutex::qmutex_ [protected]