24 #include <core/threading/scoped_rwlock.h> 25 #include <core/threading/read_write_lock.h> 100 __lock_type = lock_type;
101 if ( initially_lock ) {
103 __refrwlock->lock_for_write();
105 __refrwlock->lock_for_read();
108 __locked = initially_lock;
121 __rawrwlock = rwlock;
122 __lock_type = lock_type;
123 if ( initially_lock ) {
130 __locked = initially_lock;
141 __refrwlock->unlock();
161 __refrwlock->lock_for_write();
163 __refrwlock->lock_for_read();
178 __refrwlock->unlock();
void lock_for_read()
Aquire a reader lock.
Fawkes library namespace.
void lock_for_write()
Aquire a writer lock.
ScopedRWLock(RefPtr< ReadWriteLock > rwlock, LockType lock_type=LOCK_WRITE, bool initially_lock=true)
Constructor.
Read/write lock to allow multiple readers but only a single writer on the resource at a time...
void relock()
Lock this rwlock, again.
LockType
What to lock for.
RefPtr<> is a reference-counting shared smartpointer.
~ScopedRWLock()
Destructor.
void unlock()
Release the lock.
void unlock()
Unlock the rwlock.