5 #include <libutl/host_thread.h> 6 #include <libutl/NamedObjectMI.h> 43 bool haveWriteLock()
const;
52 (mode ==
io_rd) ? rdlock() : wrlock();
68 return (mode ==
io_rd) ? tryrdlock() : trywrlock();
91 #if UTL_HOST_OS == UTL_OS_MINGW 94 volatile long _numReaders;
97 pthread_rwlock_t _rwlock;
99 thread_handle_t _writeLockOwner;
164 (mode ==
io_rd) ? rdlock() : wrlock();
218 return _trylock(mode);
229 return (mode ==
io_rd) ? tryrdlock() : trywrlock();
284 if (_locked) _unlock();
291 (mode ==
io_rd) ? _rdlock() : _wrlock();
315 return (mode ==
io_rd) ? _tryrdlock() : _trywrlock();
323 if (_rwlock->tryrdlock()) _locked =
true;
332 if (_rwlock->trywrlock()) _locked =
true;
bool trylock(RWlock *rwlock, uint_t mode)
Try to acquire read- or write-lock (without blocking).
bool trywrlock(RWlock *rwlock)
Try to acquire write-lock (without blocking).
void rdlock()
Acquire read-lock.
void deInit()
De-initialize UTL++.
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
bool trylock(uint_t mode)
Try to acquire read- or write-lock (without blocking).
bool tryrdlock(RWlock *rwlock)
Try to acquire read-lock (without blocking).
void wrlock()
Acquire write-lock.
RWlockGuard()
Default constructor.
bool tryrdlock()
Try to acquire read-lock (without blocking).
Acquire/release a RWlock RAII-style.
void rdlock(RWlock *rwlock)
Acquire read-lock.
unsigned int uint_t
Unsigned integer.
void lock(uint_t mode)
Acquire read- or write-lock.
void lock(uint_t mode)
Acquire read- or write-lock.
bool trylock(uint_t mode)
Try to acquire read- or write-lock (without blocking).
~RWlockGuard()
Destructor.
RWlockGuard(RWlock *rwlock, uint_t mode)
Constructor.
#define UTL_CLASS_NO_COPY
Declare that a class cannot do copy().
bool trywrlock()
Try to acquire write-lock (without blocking).
void unlock()
Release the lock.
void wrlock(RWlock *rwlock)
Acquire write-lock.
Root of UTL++ class hierarchy.
void lock(RWlock *rwlock, uint_t mode)
Acquire read- or write-lock.
void init()
Initialize UTL++.
#define ASSERTD
Do an assertion in DEBUG mode only.