#include <Lockable.h>
Inheritance diagram for Lockable:
Public Methods | |
virtual | ~Lockable () throw () |
Destroy a Lockable object. | |
virtual void | acquire ()=0 |
virtual bool | tryAcquire (unsigned long)=0 |
virtual void | release ()=0 |
The following text describes the specific meaning of acqurie-release semantics in more detail.
Acquiring/Releasing
Acquiring a Lockable object means that a check point has been reached. If execution can continue, the Lockable object may be acquire()d.
Releasing a Lockable object means that a check point is being left.
The details of these semantics are refined further by specializaions of this class, but the general conotation remains intact.
For example, A Mutex class implements the Lockable interface to provide a strict protocol for acquire()ing and release()ing mutually exclusive access to something.
A Semaphore class implements the Lockable interface to define semantics for acquire()ing and release()ing permits for something, which may or may not be exclusive.
|
Acquire the Lockable object. This method may or may not block the caller for an indefinite amount of time. Those details are defined by specializations of this class.
Implemented in ClassLockable, CountingSemaphore, FastMutex, FastRecursiveMutex, Mutex, NullLockable, PriorityInheritanceMutex, PriorityMutex, PrioritySemaphore, RecursiveMutex, and Semaphore. |
|
Release the Lockable object. This method may or may not block the caller for an indefinite amount of time. Those details are defined by specializations of this class.
Implemented in ClassLockable, CountingSemaphore, FastMutex, FastRecursiveMutex, Mutex, NullLockable, PriorityInheritanceMutex, PriorityMutex, PrioritySemaphore, RecursiveMutex, and Semaphore. |
|
Attempt to acquire the Lockable object. This method may or may not block the caller for a definite amount of time. Those details are defined by specializations of this class; however, this method includes a timeout value that can be used to limit the maximum amount of time that a specialization could block.
Implemented in ClassLockable, CountingSemaphore, FastMutex, FastRecursiveMutex, Mutex, NullLockable, PriorityInheritanceMutex, PriorityMutex, PrioritySemaphore, RecursiveMutex, and Semaphore. |