ZThread::FastRecursiveMutex Class Reference

#include <FastRecursiveMutex.h>

Inheritance diagram for ZThread::FastRecursiveMutex:

ZThread::Lockable ZThread::NonCopyable List of all members.

Public Member Functions

 FastRecursiveMutex ()
 Create a new FastRecursiveMutex.
virtual ~FastRecursiveMutex ()
 Destroy this FastRecursiveMutex.
virtual void acquire ()
virtual void release ()
virtual bool tryAcquire (unsigned long timeout)

Detailed Description

Author:
Eric Crahen <http://www.code-foo.com>
Date:
<2003-07-19T19:00:25-0400>
Version:
2.2.0
A FastRecursiveMutex is a small fast implementation of a recursive, mutally exclusive Lockable object. This implementation is a bit faster than the other Mutex classes as it involved the least overhead. However, this slight increase in speed is gained by sacrificing the robustness provided by the other classes.

A FastRecursiveMutex has the useful property of not being interruptable; that is to say that acquire() and tryAcquire() will not throw Interrupted_Exceptions.

See also:
RecursiveMutex
Scheduling

Scheduling is left to the operating systems and may vary.

Error Checking

No error checking is performed, this means there is the potential for deadlock.


Member Function Documentation

void ZThread::FastRecursiveMutex::acquire (  )  [virtual]

Acquire exclusive access to the mutex. The calling thread will block until the lock can be acquired. No safety or state checks are performed. The calling thread may acquire the mutex nore than once.

Postcondition:
The calling thread obtains the lock successfully if no exception is thrown.
Exceptions:
Interrupted_Exception never thrown

Implements ZThread::Lockable.

void ZThread::FastRecursiveMutex::release (  )  [virtual]

Release access. No safety or state checks are performed.

Precondition:
the caller should have previously acquired this lock at least once.

Implements ZThread::Lockable.

bool ZThread::FastRecursiveMutex::tryAcquire ( unsigned long  timeout  )  [virtual]

Try to acquire exclusive access to the mutex. The calling thread will block until the lock can be acquired. No safety or state checks are performed. The calling thread may acquire the mutex more than once.

Parameters:
timeout unused
Returns:
  • true if the lock was acquired
  • false if the lock was acquired
Postcondition:
The calling thread obtains the lock successfully if no exception is thrown.
Exceptions:
Interrupted_Exception never thrown

Implements ZThread::Lockable.


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