|
AndroMeta
2.0.0
|
A read/write mutex allowing multiple reads to occur simultaneously. More...
#include <MRWMutex.h>
Public Member Functions | |
| MRWMutex () | |
| ~MRWMutex () | |
| void | lock () |
| bool | tryLock () |
| void | unlock () |
| void | readLock () |
| void | writeLock () |
| bool | tryReadLock () |
| bool | tryWriteLock () |
Friends | |
| class | MRWMutex_ |
A read/write mutex allowing multiple reads to occur simultaneously.
Performance-wise, MRWMutex is slower than an MMutex. Therefore MRWMutex should be used only in situations when allowing multiple reads provides a significant benefit.
Constructor.
Destructor.
| void Meta::MRWMutex::lock | ( | ) |
Alias for writeLock().
| void Meta::MRWMutex::readLock | ( | ) |
Block until a read lock is acquired. If another thread posseses a write lock, this thread blocks until it is released. No blocking occurs if there only exist outstanding read locks.
| bool Meta::MRWMutex::tryLock | ( | ) |
Alias for tryWriteLock().
| bool Meta::MRWMutex::tryReadLock | ( | ) |
Attempt to acquire a read lock on the mutex, but do not spend any time waiting.
| bool Meta::MRWMutex::tryWriteLock | ( | ) |
Attempt to acquire an exclusive write lock on the mutex, but do not spend any time waiting.
| void Meta::MRWMutex::unlock | ( | ) |
Release the lock on the mutex, whether read or write.
| void Meta::MRWMutex::writeLock | ( | ) |
Block until an exclusive write lock is acquired -- if another thread has a write lock this thread blocks until it is released, blocking also occurs if there exist outstanding read locks.
1.7.6.1