If you can read this text, it means you are not experiencing this website at its best. This website is designed for used with a standards-compliant browser.
Current version: 2.3.2
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact

FastRecursiveMutex Class Reference

#include <FastRecursiveMutex.h>

Inheritance diagram for FastRecursiveMutex:

Lockable 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

virtual void 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 Lockable.

virtual void release  )  [virtual]
 

Release access. No safety or state checks are performed.

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

Implements Lockable.

virtual bool 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 Lockable.


The documentation for this class was generated from the following file: