 |
OpendTect
6.6
|
Go to the documentation of this file.
117 bool wait(
unsigned long timeout);
200 #define mLockerClassImpl( mod, clssnm, clss, lockfn, unlockfn, trylockfn ) \
201 mExpClass(mod) clssnm \
204 clssnm( clss& thelock, bool wait=true ) \
206 , islocked_( true ) \
208 if ( wait ) thelock.lockfn; \
209 else islocked_ = thelock.trylockfn; \
212 ~clssnm() { if ( islocked_ ) lock_.unlockfn; } \
213 bool isLocked() const { return islocked_; } \
215 void unLock() { islocked_ = false; lock_.unlockfn; } \
218 void lock() { islocked_ = true; lock_.lockfn; } \
231 readLock(), readUnLock(), tryReadLock() )
244 Barrier(
int nrthreads=-1,
bool immediatrelease=
true);
245 void setNrThreads(
int);
246 int nrThreads()
const {
return nrthreads_; }
248 bool waitForAll(
bool unlock=
true);
260 void releaseAllNoLock();
266 void releaseAllInternal();
273 bool immediaterelease_;
288 Thread(
void (*)(
void*),
const char* nm=
nullptr);
294 void waitForFinish();
298 const char* getName()
const;
void convWriteToReadLock()
Lock MUST be writeLocked when calling.
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:45
#define mGlobal(module)
Definition: commondefs.h:180
ThreadID lockingthread_
Only set in debug-mode.
Definition: thread.h:69
bool convReadToWriteLock()
bool wait(unsigned long timeout)
Lock that permits multiple readers to lock the object at the same time, but it will not allow any rea...
Definition: thread.h:143
#define mFDQtclass(cls)
Definition: commondefs.h:233
#define mExpClass(module)
Definition: commondefs.h:177
#define mLockerClassImpl(mod, clssnm, clss, lockfn, unlockfn, trylockfn)
Is an object that is convenient to use when a mutex should be locked and unlocked automatically when ...
Definition: thread.h:200
int getCount() const
Definition: thread.h:74
void readLock()
No writers will be active.
Mutex(bool recursive=false)
int getSystemNrProcessors()
bool tryReadLock()
No writers will be active.
void * ThreadID
Definition: thread.h:34
CallBacks object-oriented (object + method).
Definition: callback.h:62
ConditionVar statuscond_
Definition: thread.h:182
int count_
Only set in debug-mode.
Definition: thread.h:71
void convPermissiveToWriteLock()
void sleep(double seconds)
Is an object that faciliates many threads to wait for something to happen.
Definition: thread.h:110
@ all
Definition: i_layout.h:35
void permissiveWriteUnLock()
ConditionVar(const ConditionVar &)
void setCurrentThreadProcessorAffinity(int cpu)
int nrreaders_
Definition: thread.h:178
void convWriteToPermissive()
Waits for a number of threads to reach a certain point (i.e. the call to Barrier::waitForAll)....
Definition: thread.h:239
char status_
Definition: thread.h:179
#define mQtclass(cls)
Definition: commondefs.h:234
Is the base class for all threads. Start it by creating it and give it the function or CallBack to ex...
Definition: thread.h:282
ReadWriteLock(const ReadWriteLock &)
void permissiveWriteLock()
::QMutex * qmutex_
Definition: thread.h:67
bool tryWriteLock()
No readers will be active.
interface to threads that should be portable.
Definition: atomic.h:23
::QWaitCondition * cond_
Definition: thread.h:131
void writeLock()
No readers will be active.
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021