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.1
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact

# FastMutex Class Reference

`#include <FastMutex.h>`

Inheritance diagram for FastMutex:

List of all members.

## Public Member Functions
| FastMutex ()
| Create a FastMutex.
virtual | ~FastMutex ()
| Destroy a FastMutex.
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-19T18:45:39-0400>

Version:
  2.2.0

A FastMutex is a small fast implementation of a non-recursive, mutually 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 FastMutex has the useful property of not being interruptable; that is to say that acquire() and tryAcquire() will not throw Interrupted_Exceptions.

See also:
  Mutex

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. Precondition: The calling thread should not have previously acquired this lock. Deadlock will result if the same thread attempts to acquire the mutex more 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 exclusive access. No safety or state checks are performed. Precondition: the caller should have previously acquired this lock 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. Precondition: The calling thread should not have previously acquired this lock. Deadlock will result if the same thread attempts to 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:

- FastMutex.h