OpendTect  6.6
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 ()
 
int getCount () const
 
void lock ()
 
bool tryLock ()
 
void unLock ()
 

Protected Attributes

int count_
 Only set in debug-mode. More...
 
ThreadID lockingthread_
 Only set in debug-mode. More...
 
QMutex * qmutex_
 

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

◆ Mutex() [1/2]

Threads::Mutex::Mutex ( bool  recursive = false)

◆ Mutex() [2/2]

Threads::Mutex::Mutex ( const Mutex )

◆ ~Mutex()

virtual Threads::Mutex::~Mutex ( )
virtual

Member Function Documentation

◆ getCount()

int Threads::Mutex::getCount ( ) const
inline

◆ lock()

void Threads::Mutex::lock ( )

◆ tryLock()

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.

◆ unLock()

void Threads::Mutex::unLock ( )

Member Data Documentation

◆ count_

int Threads::Mutex::count_
protected

Only set in debug-mode.

◆ lockingthread_

ThreadID Threads::Mutex::lockingthread_
protected

Only set in debug-mode.

◆ qmutex_

QMutex* Threads::Mutex::qmutex_
protected

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