OpendTect
7.0
|
Is a lock that allows a thread to have exlusive rights to something. More...
Public Member Functions | |
Mutex (bool recursive=false) | |
Mutex (const Mutex &)=delete | |
virtual | ~Mutex () |
int | getCount () const |
bool | isRecursive () const |
void | lock () |
bool | tryLock () |
void | unLock () |
Protected Attributes | |
int | count_ = 0 |
Only set in debug-mode. More... | |
ThreadID | lockingthread_ = 0 |
Only set in debug-mode. More... | |
QMutex * | qmutex_ = nullptr |
QRecursiveMutex * | qrecursivemutex_ = nullptr |
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.
<>
Threads::Mutex::Mutex | ( | bool | recursive = false | ) |
|
delete |
|
virtual |
|
inline |
|
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 | ( | ) |
|
protected |
Only set in debug-mode.
|
protected |
Only set in debug-mode.
|
protected |
|
protected |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024