cpp-pthread
(v1.7.3)
Simple C++ wrapper to pthread functions.
|
#include <read_write_lock.hpp>
Public Member Functions | |
void | lock () |
void | try_lock () |
write_lock () | |
virtual | ~write_lock () |
![]() | |
void | lock () |
void | try_lock () |
void | unlock () |
virtual | ~read_lock () |
Additional Inherited Members | |
![]() | |
read_lock () | |
![]() | |
pthread_rwlock_t | _rwlock |
This class acquires the read/write write lock
Definition at line 85 of file read_write_lock.hpp.
pthread::write_lock::write_lock | ( | ) |
Constructor/Desctructor
this constructor shall allocate any resources required to use the read-write lock referenced by rwlock and initializes the lock to an unlocked state. The read/write lock passes NULL attributes. This means default behavior.
read_write_lock_exception | if error conditions preventing this method to succeed. |
Definition at line 21 of file read_write_lock.cpp.
|
virtual |
the descructor, shall destroy the read-write lock object referenced by rwlock and release any resources used by the lock.
Definition at line 26 of file read_write_lock.cpp.
void pthread::write_lock::lock | ( | ) |
The method apply a write lock.
The calling thread acquires the write lock if no other thread (reader or writer) holds the read-write lock. Otherwise, the thread shall block until it can acquire the lock. The calling thread may deadlock if at the time the call is made it holds the read-write lock (whether a read or write lock).
Definition at line 7 of file read_write_lock.cpp.
void pthread::write_lock::try_lock | ( | ) |
The method shall apply a write lock, if any thread currently holds the lock (for reading or writing) the method throws an exception.
Definition at line 14 of file read_write_lock.cpp.