csp::common::BarrierSyncer Class Reference

Inheritance diagram for csp::common::BarrierSyncer:

csp::CSProcess csp::ThreadCSProcess boost::noncopyable List of all members.

Detailed Description

This process syncs on a barrier a specified number of times, then finishes.

When the process starts up, it enrolls on the barrier, then syncs a specified number of times and then resigns from the barrier and finishes. You will probably want to pass a pre-enrolled barrier end to the constructor, rather than letting the process be unenrolled until it starts up in future (in the mean-time, before it enrolls, syncs will succeed without this process).

To use this process, you will need to include <cppcsp/common/barrier_bucket.h>


Public Member Functions

 BarrierSyncer (const Mobile< BarrierEnd > &_end, const int _times=1)
 Constructs the BarrierSyncer to use the specified barrier-end.

Protected Member Functions

void run ()
 You must implement this function to provide the code for your process.


Constructor & Destructor Documentation

csp::common::BarrierSyncer::BarrierSyncer ( const Mobile< BarrierEnd > &  _end,
const int  _times = 1 
) [inline]

Constructs the BarrierSyncer to use the specified barrier-end.

Parameters:
_end The barrier-end to use for sync()ing on.
_times The number of times to sync() on the barrier. Defaults to one.


Member Function Documentation

void csp::common::BarrierSyncer::run (  )  [inline, protected, virtual]

You must implement this function to provide the code for your process.

When the run method finishes, the process will terminate.

You should not let an uncaught exception cause the end of this function. If it derives from std::exception, it will be caught (although this behaviour should not be relied upon) but otherwise undefined behaviour will result.

Implements csp::ThreadCSProcess.


Generated on Mon Aug 20 12:24:29 2007 for C++CSP2 by  doxygen 1.4.7