Inheritance diagram for csp::common::BarrierSyncer:
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. |
csp::common::BarrierSyncer::BarrierSyncer | ( | const Mobile< BarrierEnd > & | _end, | |
const int | _times = 1 | |||
) | [inline] |
Constructs the BarrierSyncer to use the specified barrier-end.
_end | The barrier-end to use for sync()ing on. | |
_times | The number of times to sync() on the barrier. Defaults to one. |
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.