libDwm-0.6.0
Dwm::Pthread::ReadWriteLock Class Reference

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.
 

Detailed Description

This class is just a simple wrapper around pthread_rwlock* functions from the pthread library.

Member Function Documentation

◆ ReadLock()

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.

◆ TryReadLock()

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).

◆ TryWriteLock()

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).


The documentation for this class was generated from the following file: