ZThread::Waitable Class Reference

#include <Waitable.h>

Inheritance diagram for ZThread::Waitable:

ZThread::Barrier< Count, LockType > ZThread::Condition ZThread::Executor ZThread::PriorityCondition ZThread::Thread ZThread::ConcurrentExecutor ZThread::PoolExecutor ZThread::SynchronousExecutor ZThread::ThreadedExecutor List of all members.

Public Member Functions

virtual ~Waitable ()
 Destroy a Waitable object.
virtual void wait ()=0
virtual bool wait (unsigned long timeout)=0

Detailed Description

Author:
Eric Crahen <http://www.code-foo.com>
Date:
<2003-07-16T22:16:41-0400>
Version:
2.3.0
The Waitable interface defines a common method of adding generic wait semantics to a class.

Waiting

An object implementing the Waitable interface externalizes a mechanism for testing some internal condition. Another object may wait()s for a Waitable object; in doing so, it wait()s for that condition to become true by blocking the caller while the condition is false.

For example, a Condition is Waitable object that extends wait semantics so that wait()ing means a thread is blocked until some external stimulus specifically performs an operation on the Condition to make its internal condition true. (serialization aside)

A Barrier extends wait semantics so that wait()ing mean waiting for other waiters, and may include automatically resetting the condition once a wait is complete.

See also:
Condition

Barrier

Executor


Member Function Documentation

virtual bool ZThread::Waitable::wait ( unsigned long  timeout  )  [pure virtual]

Waiting on an object will generally cause the calling thread to be blocked for some indefinite period of time. The thread executing will not proceed any further until the Waitable object releases it unless or an exception is thrown.

Parameters:
timeout maximum amount of time, in milliseconds, to spend waiting.
Returns:
  • true if the set of tasks being wait for complete before timeout milliseconds elapse.
  • false othewise.

Implemented in ZThread::Barrier< Count, LockType >, ZThread::ConcurrentExecutor, ZThread::Condition, ZThread::PoolExecutor, ZThread::PriorityCondition, ZThread::SynchronousExecutor, ZThread::Thread, and ZThread::ThreadedExecutor.

virtual void ZThread::Waitable::wait (  )  [pure virtual]

Waiting on an object will generally cause the calling thread to be blocked for some indefinite period of time. The thread executing will not proceed any further until the Waitable object releases it unless or an exception is thrown.

Implemented in ZThread::Barrier< Count, LockType >, ZThread::ConcurrentExecutor, ZThread::Condition, ZThread::PoolExecutor, ZThread::PriorityCondition, ZThread::SynchronousExecutor, ZThread::Thread, and ZThread::ThreadedExecutor.


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