Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

ost::ThreadLock Class Reference

The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have rwlock support, and reverts to a simple mutex for those that do not. Posix rwlock extension for protected access. More...

#include <thread.h>

List of all members.

Public Methods

 ThreadLock ()
 Create a process shared thread lock object. More...

virtual ~ThreadLock ()
 Destroy a process shared thread lock object. More...

void ReadLock (void)
 Aquire a read lock for the current object. More...

void WriteLock (void)
 Aquire a write lock for the current object. More...

bool TryReadLock (void)
 Attempt read lock for current object. More...

bool TryWriteLock (void)
 Attempt write lock for current object. More...

void Unlock (void)
 Release any held locks. More...


Detailed Description

The ThreadLock class impliments a thread rwlock for optimal reader performance on systems which have rwlock support, and reverts to a simple mutex for those that do not. Posix rwlock extension for protected access.

Author:
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

ost::ThreadLock::ThreadLock  
 

Create a process shared thread lock object.

virtual ost::ThreadLock::~ThreadLock   [virtual]
 

Destroy a process shared thread lock object.


Member Function Documentation

void ost::ThreadLock::ReadLock void  
 

Aquire a read lock for the current object.

bool ost::ThreadLock::TryReadLock void  
 

Attempt read lock for current object.

Returns:
true on success.

bool ost::ThreadLock::TryWriteLock void  
 

Attempt write lock for current object.

Returns:
true on success.

void ost::ThreadLock::Unlock void  
 

Release any held locks.

void ost::ThreadLock::WriteLock void  
 

Aquire a write lock for the current object.


The documentation for this class was generated from the following file:
Generated at Thu Jan 24 11:06:08 2002 for CommonC++ by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001