24 ML_UTILS_START_NAMESPACE
59 unsigned int _generation;
61 unsigned int _numberOfThreads;
103 unsigned int _numberOfExpectedWaits;
106 ML_UTILS_END_NAMESPACE
A barrier class that handles synchronization of multiple threads Thread-safety: This class is thread-...
Barrier(unsigned int count=0)
Creates a barrier with initial count of threads to synchronize.
bool wait()
Waits for other threads to also wait.
void setNumberOfThreads(unsigned int count)
Sets the number of threads that should synchronize with the wait call.
A helper class that ensures barrier waiting even when an exception occurs.
ScopedBarrierWaiter(Barrier &barrier, unsigned int numberOfExpectedWaits=1)
Creates a ScopedBarrierWaiter that ensures that the barrier gets numberOfExpectedWaits calls to Barri...
void wait()
Waits for the barrier (this will prevent the ScopedBarrierWaiter from waiting in its destructor).
WaitCondition implements a wait condition for thread synchronization.
boost::mutex Mutex
Defines a non-recursive mutex.