nidas
v1.2-1520
|
A C++ wrapper for a POSIX rwlock. More...
#include <ThreadSupport.h>
Public Member Functions | |
RWLock () throw () | |
Construct a POSIX rwlock. More... | |
RWLock (const RWLockAttributes &attr) throw (Exception) | |
RWLock (const RWLock &x) throw () | |
Copy constructor. More... | |
~RWLock () | |
Destruct a RWLock. More... | |
void | rdlock () throw (Exception) |
Acquire a read lock. More... | |
void | wrlock () throw (Exception) |
Acquire a write lock. More... | |
void | unlock () throw (Exception) |
Unlock the RWLock. More... | |
pthread_rwlock_t * | ptr () |
Get the pointer to the pthread_rwlock_t. More... | |
Private Member Functions | |
RWLock & | operator= (const RWLock &) |
No assignment allowed. More... | |
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.
RWLock::RWLock | ( | const RWLockAttributes & | attr | ) | |
throw | ( | Exception | |||
) |
RWLock::RWLock | ( | const RWLock & | x | ) | |
throw | ( | ||||
) |
Copy constructor.
Creates a new, unlocked rwlock.
RWLock::~RWLock | ( | ) |
Destruct a RWLock.
See man page for pthread_rwlock_destroy. RwLock must not be locked, otherwise std::terminate() is called.
References _p_rwlock, CLOG, and nidas::util::Exception::what().
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.
Referenced by nidas::dynld::UDPSampleOutput::getProjectDOM().
|
inline |
Unlock the RWLock.
Will throw an exception EPERM if the current thread does not hold a lock.
Referenced by nidas::dynld::UDPSampleOutput::releaseProjectDOM().
|
inline |
Acquire a write lock.
May throw an exception if the current thread already owns the lock.
|
private |