ZThread::Lockable Class Reference

#include <Lockable.h>

Inheritance diagram for ZThread::Lockable:

ZThread::BlockingQueue< T, LockType, StorageType > ZThread::BoundedQueue< T, LockType, StorageType > ZThread::ClassLockable< ClassType, LockType > ZThread::CountingSemaphore ZThread::FastMutex ZThread::FastRecursiveMutex ZThread::MonitoredQueue< T, LockType, StorageType > ZThread::Mutex ZThread::PriorityInheritanceMutex ZThread::PriorityMutex ZThread::PrioritySemaphore ZThread::RecursiveMutex ZThread::Semaphore List of all members.

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

Author:
Eric Crahen <http://www.code-foo.com>
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

virtual void ZThread::Lockable::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 ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::ClassLockable< ClassType, LockType >, ZThread::CountingSemaphore, ZThread::FastMutex, ZThread::FastRecursiveMutex, ZThread::MonitoredQueue< T, LockType, StorageType >, ZThread::Mutex, ZThread::PriorityInheritanceMutex, ZThread::PriorityMutex, ZThread::PrioritySemaphore, ZThread::RecursiveMutex, and ZThread::Semaphore.

virtual void ZThread::Lockable::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 ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::ClassLockable< ClassType, LockType >, ZThread::CountingSemaphore, ZThread::FastMutex, ZThread::FastRecursiveMutex, ZThread::MonitoredQueue< T, LockType, StorageType >, ZThread::Mutex, ZThread::PriorityInheritanceMutex, ZThread::PriorityMutex, ZThread::PrioritySemaphore, ZThread::RecursiveMutex, and ZThread::Semaphore.

virtual bool ZThread::Lockable::tryAcquire ( unsigned long  timeout  )  [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:
  • true if the operation completes and the Lockable is acquired before the timeout expires.
  • false if the operation times out before the Lockable can be acquired.
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 ZThread::BlockingQueue< T, LockType, StorageType >, ZThread::BoundedQueue< T, LockType, StorageType >, ZThread::ClassLockable< ClassType, LockType >, ZThread::CountingSemaphore, ZThread::FastMutex, ZThread::FastRecursiveMutex, ZThread::MonitoredQueue< T, LockType, StorageType >, ZThread::Mutex, ZThread::PriorityInheritanceMutex, ZThread::PriorityMutex, ZThread::PrioritySemaphore, ZThread::RecursiveMutex, and ZThread::Semaphore.


The documentation for this class was generated from the following file:
Generated on Wed Aug 30 03:27:48 2006 for SWG EMU by  doxygen 1.4.7