46 Mutex(
bool recursive=
false );
68 const
void* lockingthread_;
73 int getCount()
const {
return count_; }
116 bool wait(
unsigned long timeout);
120 void signal(
bool all);
145 ReadWriteLock(
const ReadWriteLock&);
146 virtual ~ReadWriteLock();
156 void permissiveWriteLock();
163 void permissiveWriteUnLock();
165 bool convReadToWriteLock();
170 void convWriteToReadLock();
173 void convPermissiveToWriteLock();
174 void convWriteToPermissive();
199 #define mLockerClassImpl( mod, clssnm, clss, lockfn, unlockfn, trylockfn ) \ 200 mExpClass(mod) clssnm \ 203 clssnm( clss& thelock, bool wait=true ) \ 205 , islocked_( true ) \ 207 if ( wait ) thelock.lockfn; \ 208 else islocked_ = thelock.trylockfn; \ 211 ~clssnm() { if ( islocked_ ) lock_.unlockfn; } \ 212 bool isLocked() const { return islocked_; } \ 214 void unLock() { islocked_ = false; lock_.unlockfn; } \ 217 void lock() { islocked_ = true; lock_.lockfn; } \ 230 readLock(), readUnLock(), tryReadLock() )
243 Barrier(
int nrthreads=-1,
bool immediatrelease=
true);
244 void setNrThreads(
int);
247 bool waitForAll(
bool unlock=
true);
259 void releaseAllNoLock();
265 void releaseAllInternal();
287 Thread(
void (*)(
void*),
const char* nm=0);
288 Thread(
const CallBack&,
const char* nm=0);
291 const void* threadID()
const;
293 void waitForFinish();
297 const char* getName()
const;
#define mExpClass(module)
Definition: commondefs.h:160
Is an object that faciliates many threads to wait for something to happen.
Definition: thread.h:108
Mutex & mutex()
Definition: thread.h:262
Lock that permits multiple readers to lock the object at the same time, but it will not allow any rea...
Definition: thread.h:141
int nrThreads() const
Definition: thread.h:245
#define mQtclass(cls)
Definition: commondefs.h:229
#define mGlobal(module)
Definition: commondefs.h:163
ConditionVar condvar_
Definition: thread.h:267
bool immediaterelease_
Definition: thread.h:272
Definition: i_layout.h:35
#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:199
bool dorelease_
Definition: thread.h:270
int nrthreads_
Definition: thread.h:268
interface to threads that should be portable.
Definition: atomic.h:28
int getSystemNrProcessors()
Is the base class for all threads. Start it by creating it and give it the function or CallBack to ex...
Definition: thread.h:283
int threadcount_
Definition: thread.h:269
int nrreaders_
Definition: thread.h:177
char status_
Definition: thread.h:178
void sleep(double seconds)
#define mFDQtclass(cls)
Definition: commondefs.h:228
Waits for a number of threads to reach a certain point (i.e. the call to Barrier::waitForAll). Once everyone has arrived, everyone is released.
Definition: thread.h:240
ConditionVar statuscond_
Definition: thread.h:181
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:43
void setCurrentThreadProcessorAffinity(int cpu)
const void * currentThread()
CallBacks object-oriented (object + method).
Definition: callback.h:57