Barrier Class Template Reference
#include <Barrier.h>
Inheritance diagram for Barrier:
Public Member Functions | |
Barrier () | |
Create a Barrier. | |
Barrier (const Task &task) | |
virtual | ~Barrier () |
Destroy this Barrier. | |
virtual void | wait () |
virtual bool | wait (unsigned long timeout) |
void | shatter () |
void | reset () |
Detailed Description
template<unsigned int Count, class LockType>
class ZThread::Barrier< Count, LockType >
- Author:
- Eric Crahen <http://www.code-foo.com>
- Date:
- <2003-07-16T09:54:01-0400>
- Version:
- 2.2.1
An optional Runnable command may be associated with the Barrier. This will be run() when the Nth thread arrives and Barrier is not broken.
Error Checking
A Barrier uses an all-or-nothing. All threads involved must successfully meet at Barrier. If any one of those threads leaves before all the threads have (as the result of an error or exception) then all threads present at the Barrier will throw BrokenBarrier_Exception.
A broken Barrier will cause all threads attempting to wait() on it to throw a BrokenBarrier_Exception.
A Barrier will remain 'broken', until it is manually reset().
Constructor & Destructor Documentation
|
Create a Barrier that executes the given task when all threads arrive without error
|
Member Function Documentation
|
Reset the Barrier.
|
|
Break the Barrier ending the wait for any threads that were waiting on the barrier.
|
|
Enter barrier and wait for the other threads to arrive. This can block up to the amount of time specified with the timeout parameter. The barrier will not break if a thread leaves this function due to a timeout.
Implements Waitable. |
|
Enter barrier and wait for the other threads to arrive. This can block for an indefinite amount of time.
Implements Waitable. |
The documentation for this class was generated from the following file:
- Barrier.h