Barrier synchronization object.
More...
#include <base/concurrency/Barrier.h>
Inherits Object.
Barrier synchronization object.
Implementation of a barrier.
- See also
- Event MutualExclusion Semaphore
- Version
- 1.0
◆ Barrier()
Initializes the barrier with a count of 0. Raises ResourceException if unable to allocate the required resources.
◆ ~Barrier()
◆ getCount()
unsigned int Barrier::getCount |
( |
| ) |
const |
Returns the barrier count.
◆ getWaiting()
unsigned int Barrier::getWaiting |
( |
| ) |
const |
Returns the number of waiting threads.
◆ reset()
Resets the barrier. This method is used to wake up all waiting threads before the barrier count has been reached.
◆ setCount()
void Barrier::setCount |
( |
unsigned int |
value | ) |
|
◆ wait()
unsigned int Barrier::wait |
( |
bool |
reset = false | ) |
|
The executing thread blocks until the barrier has been reached (i.e. the number of waiting threads equals the barrier count).
- Parameters
-
reset | Specifies whether or not to reset. |
- Returns
- The number of still waiting threads.
◆ count
unsigned int Barrier::count = 0 |
|
protected |
◆ event
◆ guard
◆ mutex
◆ resetEvent
Event Barrier::resetEvent |
|
protected |
◆ waiting
unsigned int Barrier::waiting = 0 |
|
protected |
The number of waiting threads.