If you can read this text, it means you are not experiencing this website at its best. This website is designed for used with a standards-compliant browser.
Current version: 2.3.2
ZThreads
A platform-independent, multi-threading and synchronization library for C++
Home Documentation Downloads CVS Contact

Waitable Class Reference

#include <Waitable.h>

Inheritance diagram for Waitable:

Barrier Condition Executor PriorityCondition Thread ConcurrentExecutor PoolExecutor SynchronousExecutor 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 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 Barrier, ConcurrentExecutor, Condition, PoolExecutor, PriorityCondition, SynchronousExecutor, Thread, and ThreadedExecutor.

virtual void 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 Barrier, ConcurrentExecutor, Condition, PoolExecutor, PriorityCondition, SynchronousExecutor, Thread, and ThreadedExecutor.


The documentation for this class was generated from the following file: