OpendTect
7.0
|
Is an object that faciliates many threads to wait for something to happen. More...
Public Member Functions | |
ConditionVar () | |
ConditionVar (const ConditionVar &) | |
~ConditionVar () | |
void | signal (bool all) |
void | wait () |
bool | wait (unsigned long timeout) |
Public Member Functions inherited from Threads::Mutex | |
Mutex (bool recursive=false) | |
Mutex (const Mutex &)=delete | |
virtual | ~Mutex () |
int | getCount () const |
bool | isRecursive () const |
void | lock () |
bool | tryLock () |
void | unLock () |
Protected Attributes | |
QWaitCondition * | cond_ |
Protected Attributes inherited from Threads::Mutex | |
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 an object that faciliates many threads to wait for something to happen.
Usage:
From the working thread
It is wise to put an exit flag in the loop, so it's possible to say that we are about to quit.
From the manager: When you want to change the condition:
unLock
<>
Threads::ConditionVar::ConditionVar | ( | ) |
Threads::ConditionVar::ConditionVar | ( | const ConditionVar & | ) |
Threads::ConditionVar::~ConditionVar | ( | ) |
void Threads::ConditionVar::signal | ( | bool | all | ) |
If all is true, all threads that have called wait() will be Notified about the signal. If all is false, only one thread will respond.
void Threads::ConditionVar::wait | ( | ) |
bool Threads::ConditionVar::wait | ( | unsigned long | timeout | ) |
timeout | is in milliseconds. |
false | if timeout was hit |
|
protected |
Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2024