|
Fawkes API
Fawkes Development Version
|
Read/write lock with reference counting. More...
#include <core/threading/refc_rwlock.h>

Public Member Functions | |
| RefCountRWLock (ReadWriteLock::ReadWriteLockPolicy policy=ReadWriteLock::RWLockPolicyPreferWriter) | |
| Constructor. | |
| virtual | ~RefCountRWLock () |
| Destructor. | |
Public Member Functions inherited from fawkes::ReadWriteLock | |
| ReadWriteLock (ReadWriteLockPolicy policy=RWLockPolicyPreferWriter) | |
| Constructor. | |
| virtual | ~ReadWriteLock () |
| Destructor. | |
| void | lock_for_read () |
| Aquire a reader lock. | |
| void | lock_for_write () |
| Aquire a writer lock. | |
| bool | try_lock_for_read () |
| Tries to aquire a reader lock. | |
| bool | try_lock_for_write () |
| Tries to aquire a writer lock. | |
| void | unlock () |
| Release the lock. | |
Public Member Functions inherited from fawkes::RefCount | |
| RefCount () | |
| Constructor. | |
| virtual | ~RefCount () |
| Destructor. | |
| void | ref () |
| Increment reference count. | |
| void | unref () |
| Decrement reference count and conditionally delete this instance. | |
| unsigned int | refcount () |
| Get reference count for this instance. | |
Additional Inherited Members | |
Public Types inherited from fawkes::ReadWriteLock | |
| enum | ReadWriteLockPolicy { RWLockPolicyPreferWriter, RWLockPolicyPreferReader } |
| The policy to use for the read/write lock. More... | |
Read/write lock with reference counting.
This class is a combination of ReadWriteLock and RefCount. A reference count is maintained for the class to allow for automatic destruction when the last user calls unref(). The class otherwise acts as a normal ReadWriteLock, you just should not delete the instance but rather unref() it.
Definition at line 33 of file refc_rwlock.h.
| fawkes::RefCountRWLock::RefCountRWLock | ( | ReadWriteLock::ReadWriteLockPolicy | policy = ReadWriteLock::RWLockPolicyPreferWriter | ) |
Constructor.
| policy | Policy, see ReadWriteLock::ReadWriteLock() for more info on this. |
Definition at line 44 of file refc_rwlock.cpp.
|
virtual |
Destructor.
Definition at line 50 of file refc_rwlock.cpp.