|
nidas v1.2.3
|
A C++ wrapper for a POSIX rwlock. More...
#include <ThreadSupport.h>
Public Member Functions | |
| RWLock () throw () | |
| Construct a POSIX rwlock. | |
| RWLock (const RWLockAttributes &attr) | |
| RWLock (const RWLock &x) throw () | |
| Copy constructor. | |
| ~RWLock () | |
| Destruct a RWLock. | |
| void | rdlock () |
| Acquire a read lock. | |
| void | wrlock () |
| Acquire a write lock. | |
| void | unlock () |
| Unlock the RWLock. | |
| pthread_rwlock_t * | ptr () |
| Get the pointer to the pthread_rwlock_t. | |
Private Member Functions | |
| RWLock & | operator= (const RWLock &) |
| No assignment allowed. | |
Private Attributes | |
| pthread_rwlock_t | _p_rwlock |
| RWLockAttributes | _attrs |
A C++ wrapper for a POSIX rwlock.
| RWLock::RWLock | ( | ) | ||||
| throw | ( | ) | ||||
Construct a POSIX rwlock.
See man page for pthread_rwlock_init.
References _attrs, _p_rwlock, and nidas::util::RWLockAttributes::ptr().
| RWLock::RWLock | ( | const RWLockAttributes & | attr | ) |
| Exception |
References _attrs, _p_rwlock, and nidas::util::RWLockAttributes::ptr().
| RWLock::RWLock | ( | const RWLock & | x | ) | ||
| throw | ( | ) | ||||
Copy constructor.
Creates a new, unlocked rwlock.
| RWLock::~RWLock | ( | ) |
| pthread_rwlock_t * RWLock::ptr | ( | ) |
Get the pointer to the pthread_rwlock_t.
References _p_rwlock.
|
inline |
Acquire a read lock.
May throw an exception if the maximum number of read locks for this RWLock has been exceeded.
| Exception |
References _p_rwlock.
Referenced by nidas::util::AutoRdLock::AutoRdLock(), and nidas::dynld::UDPSampleOutput::getProjectDOM().
|
inline |
Unlock the RWLock.
Will throw an exception EPERM if the current thread does not hold a lock.
| Exception |
References _p_rwlock.
Referenced by nidas::dynld::UDPSampleOutput::releaseProjectDOM(), nidas::util::AutoRdLock::~AutoRdLock(), and nidas::util::AutoWrLock::~AutoWrLock().
|
inline |
Acquire a write lock.
May throw an exception if the current thread already owns the lock.
| Exception |
References _p_rwlock.
Referenced by nidas::util::AutoWrLock::AutoWrLock().
|
private |
|
private |