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

Phx::Lock Class Reference

A standard lock (mutex) object. More...

#include <PhxLocks.h>

List of all members.

Public Member Functions

 Lock (bool recursive=false)
 Initializes a new lock this is initially unlocked. This lock will be non recursive by default.
 ~Lock ()
 Destroys this lock.
void lock (void) const
 Acquires the lock.
void unlock (void) const
 Releases the lock.
bool isRecursive ()


Detailed Description

A standard lock (mutex) object.

A mutex is a simple lock that allows enforcement of mutually exclusive access to a piece of data. Only a single thread is allowed to hold the lock for any purpose at a given time.


Constructor & Destructor Documentation

Phx::Lock::Lock bool  recursive = false  ) 
 

Initializes a new lock this is initially unlocked. This lock will be non recursive by default.

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

Phx::Lock::~Lock  ) 
 

Destroys this lock.

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


Member Function Documentation

void Phx::Lock::lock void   )  const
 

Acquires the lock.

Calling this will lock this mutex. It will remain locked until unlock() is called. This forces all other threads requesting the lock to block.

void Phx::Lock::unlock void   )  const
 

Releases the lock.

Calling this will unlock this mutex, allowing another thread to acquire the lock if necessary.


The documentation for this class was generated from the following file:
Generated on Mon Jul 10 19:45:30 2006 for Phoenix OSFS by  doxygen 1.4.2