ZThread::MutexImpl< List, Behavior > Class Template Reference

#include <MutexImpl.h>

List of all members.

Public Member Functions

 MutexImpl ()
 ~MutexImpl ()
void acquire ()
void release ()
bool tryAcquire (unsigned long timeout)


Detailed Description

template<typename List, typename Behavior>
class ZThread::MutexImpl< List, Behavior >

Author:
Eric Crahen <http://www.code-foo.com>
Date:
<2003-07-16T19:52:12-0400>
Version:
2.2.11
The MutexImpl template allows how waiter lists are sorted, and what actions are taken when a thread interacts with the mutex to be parametized.


Constructor & Destructor Documentation

template<typename List, typename Behavior>
ZThread::MutexImpl< List, Behavior >::MutexImpl (  )  [inline]

Create a new MutexImpl

Exceptions:
Initialization_Exception thrown if resources could not be properly allocated

template<typename List, typename Behavior>
ZThread::MutexImpl< List, Behavior >::~MutexImpl (  ) 

Destroy this MutexImpl and release its resources


Member Function Documentation

template<typename List, typename Behavior>
void ZThread::MutexImpl< List, Behavior >::acquire (  ) 

Acquire a lock on the mutex. If this operation succeeds the calling thread holds an exclusive lock on this mutex, otherwise it is blocked until the lock can be acquired.

Exceptions:
Deadlock_Exception thrown when the caller attempts to acquire() more than once, If the checking flag is set.
Interrupted_Exception thrown when the caller status is interrupted
Synchronization_Exception thrown if there is some other error.

template<typename List, typename Behavior>
void ZThread::MutexImpl< List, Behavior >::release (  ) 

Release a lock on the mutex. If this operation succeeds the calling thread no longer holds an exclusive lock on this mutex. If there are waiting threads, one will be selected, assigned ownership and specifically awakened.

Exceptions:
InvalidOp_Exception - thrown if an attempt is made to release a mutex not owned by the calling thread.

template<typename List, typename Behavior>
bool ZThread::MutexImpl< List, Behavior >::tryAcquire ( unsigned long  timeout  ) 

Acquire a lock on the mutex. If this operation succeeds the calling thread holds an exclusive lock on this mutex. If the lock cannot be obtained before the timeout expires, the caller returns false.

Exceptions:
Deadlock_Exception thrown when the caller attempts to acquire() more than once, If the checking flag is set.
Interrupted_Exception thrown when the caller status is interrupted
Synchronization_Exception thrown if there is some other error.


The documentation for this class was generated from the following file:
Generated on Wed Aug 30 03:27:49 2006 for SWG EMU by  doxygen 1.4.7