library of assembled shared sources |
http://lass.cocamware.com |
#include <rw_lock.h>
Public Member Functions | |
RWLock (util::CallTraits< size_t >::TParam iMaxReaders) | |
~RWLock () | |
void | lockr () |
void | lockw () |
void | unlockr () |
void | unlockw () |
const LockResult | tryLockr () |
const LockResult | tryLockw () |
Private Member Functions | |
void | swap (NonCopyable &) |
Private Attributes | |
size_t | maxReaders_ |
the maximum of simultaneous readers allowed | |
int | spinLock_ |
int | writersTrying_ |
the number of writers trying to enter |
Definition at line 73 of file rw_lock.h.
lass::util::RWLock::RWLock | ( | util::CallTraits< size_t >::TParam | iMaxReaders | ) |
lass::util::RWLock::~RWLock | ( | ) |
void lass::util::RWLock::lockr | ( | ) |
Definition at line 107 of file rw_lock.h.
References lass::util::atomicCompareAndSwap(), LASS_ASSERT, spinLock_, and writersTrying_.
void lass::util::RWLock::lockw | ( | ) |
Definition at line 119 of file rw_lock.h.
References lass::util::atomicIncrement(), maxReaders_, spinLock_, and writersTrying_.
void lass::util::RWLock::unlockr | ( | ) |
Definition at line 136 of file rw_lock.h.
References lass::util::atomicIncrement(), LASS_ASSERT, maxReaders_, and spinLock_.
void lass::util::RWLock::unlockw | ( | ) |
Definition at line 127 of file rw_lock.h.
References lass::util::atomicDecrement(), LASS_ENFORCE, maxReaders_, spinLock_, and writersTrying_.
const LockResult lass::util::RWLock::tryLockr | ( | ) |
Definition at line 143 of file rw_lock.h.
References lass::util::atomicCompareAndSwap(), LASS_ASSERT, lass::util::lockBusy, lass::util::lockSuccess, and spinLock_.
const LockResult lass::util::RWLock::tryLockw | ( | ) |
Definition at line 162 of file rw_lock.h.
References lass::util::atomicDecrement(), lass::util::atomicIncrement(), LASS_ASSERT, lass::util::lockBusy, lass::util::lockSuccess, maxReaders_, spinLock_, and writersTrying_.
void lass::util::NonCopyable::swap | ( | NonCopyable & | ) | [inline, protected, inherited] |
size_t lass::util::RWLock::maxReaders_ [private] |
int lass::util::RWLock::spinLock_ [private] |
Definition at line 90 of file rw_lock.h.
Referenced by lockr(), lockw(), RWLock(), tryLockr(), tryLockw(), unlockr(), unlockw(), and ~RWLock().
int lass::util::RWLock::writersTrying_ [private] |
Generated on Mon Nov 10 14:22:17 2008 for Library of Assembled Shared Sources by 1.5.7.1 |