OpendTect
6.6
|
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 &) | |
virtual | ~Mutex () |
int | getCount () const |
void | lock () |
bool | tryLock () |
void | unLock () |
Protected Attributes | |
QWaitCondition * | cond_ |
Protected Attributes inherited from Threads::Mutex | |
int | count_ |
Only set in debug-mode. More... | |
ThreadID | lockingthread_ |
Only set in debug-mode. More... | |
QMutex * | qmutex_ |
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-2022