Qore Programming Language Reference Manual 1.19.2
Loading...
Searching...
No Matches
QC_RWLock.dox.h
1
2namespace Qore {
4namespace Thread {
6
40class RWLock : public AbstractSmartLock {
41
42public:
44
50
51public:
53
59
60public:
62
72
73public:
75
86
87public:
89
100
101public:
103
115
116public:
118
129
130public:
132
140nothing readLock();
141
142public:
144
162int readLock(timeout timeout_ms);
163
164public:
166
178
179public:
181
188nothing readUnlock();
189
190public:
192
203
204public:
206
216
217public:
219
237int writeLock(timeout timeout_ms);
238
239public:
241
249nothing writeLock();
250
251public:
253
265
266public:
268
275nothing writeUnlock();
276};
277}
278}
The abstract base class for locks that support the internal API for use with the Condition class.
Definition: QC_AbstractSmartLock.dox.h:15
The RWLock class implements a read-write thread lock.
Definition: QC_RWLock.dox.h:40
int writeLock(timeout timeout_ms)
Acquires the write lock with a timeout value; blocks if the read lock is already acquired by another ...
int readLock(timeout timeout_ms)
Acquires the read lock with a timeout value; blocks if the write lock is already acquired by another ...
nothing writeLock()
Acquires the write lock; blocks if the read lock is already acquired by another thread.
nothing readUnlock()
Decrements the read lock counter and releases the read lock if the counter is zero....
int tryWriteLock()
Acquires the write lock only if it can be acquired immediately.
constructor()
Creates the RWLock object.
bool readLockOwner()
Returns True if the current thread is holding the read lock, False if not.
destructor()
Destroys the RWLock object.
nothing writeUnlock()
Releases the write lock, if any readers are waiting, wakes up all readers, otherwise if any writers a...
int numReaders()
Returns the read lock count.
bool writeLockOwner()
Returns True if the current thread is holding the write lock, False if not.
copy()
Creates a new RWLock object, not based on the original.
int getWriteWaiting()
Returns the number of threads waiting on the write lock.
int getReadWaiting()
Returns the number of threads waiting on the read lock.
nothing readLock()
Acquires the read lock; blocks if the write lock is already acquired by another thread.
int tryReadLock()
Acquires the read lock only if it can be acquired immediately.
bool lockOwner()
Returns True if the current thread is holding either the read lock or the write lock,...
Qore namespace.
Definition: QC_AbstractSmartLock.dox.h:2