Google

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

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.

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

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

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

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.


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(s):
David Sugar <dyfet@ostel.com>


Constructor & Destructor Documentation

ThreadLock::ThreadLock ( )
 

Create a process shared thread lock object.

ThreadLock::~ThreadLock ( )
 

Destroy a process shared thread lock object.


Member Function Documentation

void ThreadLock::ReadLock ( void )
 

Aquire a read lock for the current object.

bool ThreadLock::TryReadLock ( void )
 

Attempt read lock for current object.

Returns:
true on success.

bool ThreadLock::TryWriteLock ( void )
 

Attempt write lock for current object.

Returns:
true on success.

void ThreadLock::Unlock ( void )
 

Release any held locks.

void ThreadLock::WriteLock ( void )
 

Aquire a write lock for the current object.


The documentation for this class was generated from the following file:
Generated at Fri Mar 23 10:47:57 2001 for CommonC++ by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000