AndroMeta  2.0.0
Public Member Functions | Friends
Meta::MRWMutex Class Reference

A read/write mutex allowing multiple reads to occur simultaneously. More...

#include <MRWMutex.h>

List of all members.

Public Member Functions

 MRWMutex ()
 ~MRWMutex ()
void lock ()
bool tryLock ()
void unlock ()
void readLock ()
void writeLock ()
bool tryReadLock ()
bool tryWriteLock ()

Friends

class MRWMutex_

Detailed Description

A read/write mutex allowing multiple reads to occur simultaneously.

Performance-wise, MRWMutex is slower than an MMutex. Therefore MRWMutex should be used only in situations when allowing multiple reads provides a significant benefit.


Constructor & Destructor Documentation

Constructor.

Destructor.


Member Function Documentation

Alias for writeLock().

Block until a read lock is acquired. If another thread posseses a write lock, this thread blocks until it is released. No blocking occurs if there only exist outstanding read locks.

Alias for tryWriteLock().

Attempt to acquire a read lock on the mutex, but do not spend any time waiting.

Returns:
true on success.

Attempt to acquire an exclusive write lock on the mutex, but do not spend any time waiting.

Returns:
true on success.

Release the lock on the mutex, whether read or write.

Block until an exclusive write lock is acquired -- if another thread has a write lock this thread blocks until it is released, blocking also occurs if there exist outstanding read locks.


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