Main Page   Namespace List   Class Hierarchy   Compound List   Compound Members  

ZThread::Mutex Class Reference

#include <Mutex.h>

Inheritance diagram for ZThread::Mutex::

ZThread::Lockable List of all members.

Public Methods

 Mutex () throw (Synchronization_Exception)
virtual ~Mutex () throw ()
virtual void acquire () throw (Synchronization_Exception)
virtual bool tryAcquire (unsigned long) throw (Synchronization_Exception)
virtual void release () throw (Synchronization_Exception)

Detailed Description

Author:
Eric Crahen
Version:
1.5.0
Date:
07-31-2001

Basic MUTual EXclusion object. This mutex will perform checks before a wait is entered to see if the thread has been interrupted. However, once a thread is blocked by this mutex it can't be interrupted.

This classes behavoir is very similar to the CheckedMutex except that it will not check for deadlock.


Constructor & Destructor Documentation

Mutex ( ) throw (Synchronization_Exception)
 

Allocate a new mutex

Exceptions:
Initialization_Exception   - thrown if there are not enough available resources

~Mutex ( ) throw () [virtual]
 

Destroy this Mutex object


Member Function Documentation

void acquire ( ) throw (Synchronization_Exception) [virtual]
 

Acquire a lock on this mutex.

Acquiring this mutex twice will result in deadlock.

Exceptions:
Interrupted_Exception  
Unexpected_Exception  
Synchronization_Exception   - error with the underlying synchronization mechanisms

Reimplemented from ZThread::Lockable.

void release ( ) throw (Synchronization_Exception) [virtual]
 

Release a lock held on this mutex.

Once released, another thread may acquire the mutex.

Exceptions:
Synchronization_Exception  

Reimplemented from ZThread::Lockable.

bool tryAcquire ( unsigned long timeout ) throw (Synchronization_Exception) [virtual]
 

Acquire a lock on this mutex.

Acquiring this mutex twice will result in deadlock.

Parameters:
unsigned   long - spend no more than given amount of time waiting for the mutex

Returns:
true if the mutex was acquire in time, false if not
Exceptions:
Interrupted_Exception  
Unexpected_Exception  
Synchronization_Exception   - error with the underlying synchronization mechanisms
Parameters:
timeout  

Reimplemented from ZThread::Lockable.


The documentation for this class was generated from the following file:
Generated at Fri Aug 31 09:08:01 2001 for ZThread by doxygen1.2.8 written by Dimitri van Heesch, © 1997-2001