This class is just a simple wrapper around pthread_rwlock* functions from the pthread library. More...
#include <DwmPthreadReadWriteLock.hh>
Public Member Functions | |
| ReadWriteLock (const pthread_rwlockattr_t *attr=0) | |
| Constructor. | |
| ReadWriteLock (const ReadWriteLock &rwlock) | |
| ~ReadWriteLock () | |
| Destructor. | |
| bool | ReadLock () |
| Acquires a read lock. More... | |
| int | TryReadLock () |
| Acquires a read lock. More... | |
| bool | WriteLock () |
| Acquires a write lock. Returns true on success, false on failure. | |
| int | TryWriteLock () |
| Acquires a write lock. More... | |
| bool | Unlock () |
| Unlocks. Returns true on success, false on failure. | |
This class is just a simple wrapper around pthread_rwlock* functions from the pthread library.
| bool Dwm::Pthread::ReadWriteLock::ReadLock | ( | ) |
Acquires a read lock.
If the lock can't be acquired immediately, blocks until the lock can be acquired. Returns true on success, false on failure.
| int Dwm::Pthread::ReadWriteLock::TryReadLock | ( | ) |
Acquires a read lock.
Returns EBUSY if the lock can't be acquired immediately (due to a write lock). Returns 0 on success. Other return values indicate an error (see the pthread_rwlock_tryrdlock() manpage).
| int Dwm::Pthread::ReadWriteLock::TryWriteLock | ( | ) |
Acquires a write lock.
Returns EBUSY if the lock can't be acquired immediately (due to other lock(s)). Returns 0 on success. Other return values indicate an error (see the pthread_rwlock_trywrlock() manpage).