Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

Phx::ReadWriteLock Class Reference

A read/write lock object. More...

#include <PhxLocks.h>

List of all members.

Public Member Functions

 ReadWriteLock ()
 Initializes a new read-write lock that is initially unlocked.
 ~ReadWriteLock ()
 Destroys this lock.
void readLock (void) const
 Locks this reader/writer lock for reading.
void writeLock (void) const
 Locks this reader/writer lock for writing.
void unlock (void) const
 Unlocks the reader/writer lock.


Detailed Description

A read/write lock object.

A read/write lock is a special kind of lock that allows multiple readers to have access to a piece of data in parallel, but only allows a single writer to access the data at a time when no readers have the lock.


Constructor & Destructor Documentation

Phx::ReadWriteLock::ReadWriteLock  ) 
 

Initializes a new read-write lock that is initially unlocked.

Todo:
Adding logging for errors.
Exceptions:
MemoryException 
InternalException 
ResourceException thrown for various errors that may occur while creating the lock.

Phx::ReadWriteLock::~ReadWriteLock  ) 
 

Destroys this lock.

Todo:
Handle errors by logging information, but don't throw exceptions.


Member Function Documentation

void Phx::ReadWriteLock::readLock void   )  const
 

Locks this reader/writer lock for reading.

Exceptions:
ResourceException 
InternalException thrown if the read lock could not be acquired.

void Phx::ReadWriteLock::unlock void   )  const
 

Unlocks the reader/writer lock.

Exceptions:
PermissionException thrown if the caller does not hold this lock.
InternalException thrown for any other internal error.

void Phx::ReadWriteLock::writeLock void   )  const
 

Locks this reader/writer lock for writing.

Exceptions:
ResourceException 
InternalException thrown if the write lock could not be acquired.


The documentation for this class was generated from the following file:
Generated on Wed Dec 21 22:05:39 2005 for Phoenix OSFS by  doxygen 1.4.2