#include <Lockable.h>

Public Member Functions | |
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-16T10:33:32-0400>
- Version
- 2.3.0
The Lockable interface defines a common method of adding general acquire-release semantics to an object. An acquire-release protocol does not necessarily imply exclusive access.
Member Function Documentation
◆ acquire()
|
pure virtual |
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.
- Exceptions
-
Interrupted_Exception thrown if the calling thread is interrupted before the operation completes.
- Postcondition
- The Lockable is acquired only if no exception was thrown.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, ClassLockable< ClassType, LockType >, CountingSemaphore, FastMutex, FastRecursiveMutex, MonitoredQueue< T, LockType, StorageType >, Mutex, PriorityInheritanceMutex, PriorityMutex, PrioritySemaphore, RecursiveMutex, and Semaphore.
◆ release()
|
pure virtual |
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.
- Postcondition
- The Lockable is released only if no exception was thrown.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, ClassLockable< ClassType, LockType >, CountingSemaphore, FastMutex, FastRecursiveMutex, MonitoredQueue< T, LockType, StorageType >, Mutex, PriorityInheritanceMutex, PriorityMutex, PrioritySemaphore, RecursiveMutex, and Semaphore.
◆ tryAcquire()
|
pure virtual |
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.
- Parameters
-
timeout - maximum amount of time (milliseconds) this method could block
- Returns
- Exceptions
-
Interrupted_Exception thrown if the calling thread is interrupted before the operation completes.
- Postcondition
- The Lockable is acquired only if no exception was thrown.
Implemented in BlockingQueue< T, LockType, StorageType >, BoundedQueue< T, LockType, StorageType >, ClassLockable< ClassType, LockType >, CountingSemaphore, FastMutex, FastRecursiveMutex, MonitoredQueue< T, LockType, StorageType >, Mutex, PriorityInheritanceMutex, PriorityMutex, PrioritySemaphore, RecursiveMutex, and Semaphore.
The documentation for this class was generated from the following file:
- Lockable.h