Main Page   Namespace List   Class Hierarchy   Compound List   Namespace Members   Compound Members  

FastMutex Class Reference

#include <FastMutex.h>

Inheritance diagram for FastMutex:

Lockable NonCopyable List of all members.

Public Methods

 FastMutex ()
 Create a new FastMutex.

virtual ~FastMutex () throw ()
 Destroy a new FastMutex.

virtual void acquire ()
virtual void release ()
virtual bool tryAcquire (unsigned long timeout)

Detailed Description

Author:
Eric Crahen <crahen@cse.buffalo.edu>
Date:
<2002-05-30T15:38:35-0400>
Version:
2.2.0
A FastMutex is a small fast implementation of a non-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.

Typically, a FastMutex is implemented using a spin lock. It should be reserved for synchronizing short sections of code.

See also:
Mutex
Scheduling

No garuntees about the order threads are resumed in is made.

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. No safety or state checks are performed.

Exceptions:
Synchronization_Exception  never thrown
Precondition:
the caller should not have previously acquire()d this lock

Implements Lockable.

virtual void release   [virtual]
 

Release exclusive access. No safety or state checks are performed.

Exceptions:
Synchronization_Exception  never thrown
Precondition:
the caller should have previously acquire()d this lock

Implements Lockable.

virtual bool tryAcquire unsigned long    timeout [virtual]
 

Try to acquire exclusive access. No safety or state checks are performed. This function returns immediately regardless of the value of the timeout

Parameters:
timeout  - unused
Returns :
bool true if the lock was acquire()ed, otherwise false.
Exceptions:
Synchronization_Exception  never thrown
Precondition:
the caller should not have previously acquire()d this lock

Implements Lockable.


The documentation for this class was generated from the following file:
Generated on Tue Aug 27 07:43:11 2002 for ZThread by doxygen1.2.17