#include <FastMutex.h>

Public Member Functions | |
FastMutex () | |
Create a FastMutex. | |
virtual | ~FastMutex () |
Destroy a FastMutex. | |
virtual void | acquire () |
virtual void | release () |
virtual bool | tryAcquire (unsigned long timeout) |
![]() | |
virtual | ~Lockable () |
Destroy a Lockable object. | |
virtual void | acquire ()=0 |
virtual bool | tryAcquire (unsigned long timeout)=0 |
virtual void | release ()=0 |
Detailed Description
- 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
◆ 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.
◆ release()
|
virtual |
Release exclusive access. No safety or state checks are performed.
- Precondition
- the caller should have previously acquired this lock
Implements Lockable.
◆ tryAcquire()
|
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