OpendTect-6_4  6.4
Public Member Functions | Protected Attributes | List of all members
Threads::Mutex Class Reference

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

Inheritance diagram for Threads::Mutex:
[legend]

Public Member Functions

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

Protected Attributes

::QMutex * qmutex_
 
const void * lockingthread_
 Only set in debug-mode. More...
 
int count_
 Only set in debug-mode. More...
 

Detailed Description

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

It is guaranteed that once locked, no one 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

int Threads::Mutex::getCount ( ) const
inline
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

int Threads::Mutex::count_
protected

Only set in debug-mode.

const void* Threads::Mutex::lockingthread_
protected

Only set in debug-mode.

:: QMutex* Threads::Mutex::qmutex_
protected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019