#include <LOW_thread_rwlock_POSIX.h>
Inheritance diagram for LOW_thread_rwlock_POSIX:
Public Member Functions | |
virtual | ~LOW_thread_rwlock_POSIX () |
Destructor. | |
virtual void | lockRead () |
Obtain a read lock on the rwlock (blocking). | |
virtual void | tryLockRead () |
Obtain a read lock on the rwlock (non-blocking). | |
virtual void | lockWrite () |
Obtain a write lock on the rwlock (blocking). | |
virtual void | tryLockWrite () |
Obtain a write lock on the rwlock (non-blocking). | |
virtual void | unlock () |
Release a lock on the rwlock. | |
class_DERIVE_FROM_EXCEPTION (thread_rwlock_error, LOW_exception) | |
Exception base class for all exceptions thrown by LOW_thread_rwlock. | |
class_DERIVE_FROM_EXCEPTION (thread_rwlock_locked, thread_rwlock_error) | |
Exception class to indicate a mutex already locked by the calling thread. | |
class_DERIVE_FROM_EXCEPTION (thread_rwlock_busy, thread_rwlock_error) | |
Exception class to indicate a mutex locked by another thread. | |
Protected Member Functions | |
LOW_thread_rwlock_POSIX () | |
Constructor. | |
Private Attributes | |
pthread_rwlock_t | theRwlock |
The rwlock itself. | |
Friends | |
class | LOW_thread_Factory |
To allow construction. |
This class is thread-safe.
IEEE Standard 1003.1-2003 (http://www.opengroup.org/onlinepubs/007904975/toc.htm)
Parts of the documentation taken from Linux man pages by Xavier Leroy.
Parts of the documentation taken from IEEE Standard 1003.1-2003.
Definition at line 40 of file LOW_thread_rwlock_POSIX.h.
|
Destructor.
Definition at line 42 of file LOW_thread_rwlock_POSIX.cpp. References LOW_helper_msglog::printPerror(), and theRwlock. |
|
Constructor. Not publicly constructable. Use LOW_thread_Factory.
Definition at line 35 of file LOW_thread_rwlock_POSIX.cpp. References theRwlock. |
|
Exception class to indicate a mutex locked by another thread.
|
|
Exception class to indicate a mutex already locked by the calling thread.
|
|
Exception base class for all exceptions thrown by LOW_thread_rwlock.
|
|
Obtain a read lock on the rwlock (blocking). The method applies a read lock to the read-write lock. The calling thread acquires the read lock if a writer does not hold the lock and there are no writers blocked on the lock. A thread may hold multiple concurrent read locks on rwlock (that is, successfully call the lockRead() method n times). If so, the application shall ensure that the thread performs matching unlocks (that is, it calls unlock() method n times).
Implements LOW_thread_rwlock. Definition at line 57 of file LOW_thread_rwlock_POSIX.cpp. References theRwlock. |
|
Obtain a write lock on the rwlock (blocking). The method applies a write lock to the read-write lock. The calling thread acquires the write lock if no other thread (reader or writer) holds the read-write lock rwlock. Otherwise, the thread will 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).
Implements LOW_thread_rwlock. Definition at line 81 of file LOW_thread_rwlock_POSIX.cpp. References theRwlock. |
|
Obtain a read lock on the rwlock (non-blocking). The method applies a read lock as in the lockRead() method, with the exception that the function throws an exception if the equivalent lockRead() call would have blocked the calling thread. The method never blocks; it always either acquires the lock or throws a thread_rwlock_busy exception.
Implements LOW_thread_rwlock. Definition at line 68 of file LOW_thread_rwlock_POSIX.cpp. References theRwlock. |
|
Obtain a write lock on the rwlock (non-blocking). The method applies a write lock like the lockWrite() method, with the exception that the function throws an exception if any thread currently holds the rwlock (for reading or writing).
Implements LOW_thread_rwlock. Definition at line 92 of file LOW_thread_rwlock_POSIX.cpp. References theRwlock. |
|
Release a lock on the rwlock. The method releasees a lock held on the read-write lock. Results are undefined if the read-write lock rwlock is not held by the calling thread. If this method is called to release a read lock from the read-write lock object and there are other read locks currently held on this read-write lock object, the read-write lock object remains in the read locked state. If this method releases the last read lock for this read-write lock object, the read-write lock object is put in the unlocked state with no owners. If this method is called to release a write lock for this read-write lock object, the read-write lock object is put in the unlocked state.
Implements LOW_thread_rwlock. Definition at line 105 of file LOW_thread_rwlock_POSIX.cpp. References theRwlock. |
|
To allow construction.
Definition at line 148 of file LOW_thread_rwlock_POSIX.h. |
|
The rwlock itself.
Definition at line 172 of file LOW_thread_rwlock_POSIX.h. Referenced by lockRead(), lockWrite(), LOW_thread_rwlock_POSIX(), tryLockRead(), tryLockWrite(), unlock(), and ~LOW_thread_rwlock_POSIX(). |