CrystalSpace

Public API Reference

CS::Threading::Barrier Class Reference

Barrier synchronization class. More...

#include <csutil/threading/barrier.h>

Inheritance diagram for CS::Threading::Barrier:

List of all members.

Public Member Functions

 Barrier (size_t maxCount)
 Initialize barrier with set max count.
void Reset ()
 Reset a barrier for reuse.
bool Wait ()
 Wait for all threads to have called Wait.

Detailed Description

Barrier synchronization class.

A barrier is used to synchronize the execution streams of any number of threads. All threads calls Wait that will block until the set number of threads have called it.

Definition at line 37 of file barrier.h.


Constructor & Destructor Documentation

CS::Threading::Barrier::Barrier ( size_t  maxCount  )  [inline]

Initialize barrier with set max count.

Definition at line 43 of file barrier.h.


Member Function Documentation

void CS::Threading::Barrier::Reset (  )  [inline]

Reset a barrier for reuse.

Must not be called on a currently used barrier.

Definition at line 51 of file barrier.h.

bool CS::Threading::Barrier::Wait (  )  [inline]

Wait for all threads to have called Wait.

Returns:
true if caller is last thread to call Wait

Definition at line 60 of file barrier.h.


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

Generated for Crystal Space 2.1 by doxygen 1.6.1