 |
OpendTect
6.6
|
Go to the documentation of this file.
56 enum Type { BigWork, SmallWork, MultiRead };
58 Lock(
bool for_just_a_few_operations=
false);
66 inline bool isMutex()
const {
return bool(mutex_); }
68 inline bool isRWLock()
const {
return bool(rwlock_);}
88 enum WaitType { WaitIfLocked, DontWaitForLock };
101 inline bool isLocked()
const {
return needunlock_; }
void unlockSimpleSpinLock(volatile int &lock)
bool isRWLock() const
Definition: threadlock.h:68
bool isLocked() const
Definition: threadlock.h:101
RWType
Definition: threadlock.h:90
Is a lock that allows a thread to have exlusive rights to something.
Definition: thread.h:45
Locks the lock, shutting out access from other threads if needed.
Definition: threadlock.h:85
#define mGlobal(module)
Definition: commondefs.h:180
SpinLock & spinLock()
Definition: threadlock.h:70
bool lockSimpleSpinLock(volatile int &lock, Locker::WaitType)
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 mExpClass(module)
Definition: commondefs.h:177
Mutex & mutex()
Definition: threadlock.h:69
ReadWriteLock * rwlock_
Definition: threadlock.h:77
bool isread_
Definition: threadlock.h:114
WaitType
Definition: threadlock.h:88
Type
Definition: threadlock.h:56
ReadWriteLock & readWriteLock()
Definition: threadlock.h:71
bool isMutex() const
Definition: threadlock.h:66
Is an alternative to Mutex. It is a lock which causes a thread trying to acquire it to simply wait in...
Definition: atomic.h:108
Locker(Lock &, RWType, WaitType)
SpinLock * splock_
Definition: threadlock.h:76
virtual ~Locker()
Definition: threadlock.h:99
bool convertToWriteLock()
Locker(const Locker &)
intentionally not implemented
Lock(bool for_just_a_few_operations=false)
void reLock(WaitType wt=WaitIfLocked)
< Locker goes out of scope
bool needunlock_
Definition: threadlock.h:113
interface to threads that should be portable.
Definition: atomic.h:23
A lock of a type that (hopefully) suits your needs. To use it, you need the Locker class.
Definition: threadlock.h:53
Mutex * mutex_
Definition: threadlock.h:75
Lock & lock_
Definition: threadlock.h:112
bool isSpinLock() const
Definition: threadlock.h:67
Locker(Lock &, WaitType, RWType)
bool lockSimpleSpinWaitLock(volatile int &lock)
Generated at
for the OpendTect
seismic interpretation project.
Copyright (C): dGB Beheer B.V. 1995-2021