|
CppCommon 1.0.5.0
C++ Common Library
|
Barrier synchronization primitive. More...
#include <barrier.h>
Public Member Functions | |
| Barrier (int threads) | |
| Default class constructor. | |
| Barrier (const Barrier &)=delete | |
| Barrier (Barrier &&barrier)=delete | |
| ~Barrier () | |
| Barrier & | operator= (const Barrier &)=delete |
| Barrier & | operator= (Barrier &&barrier)=delete |
| int | threads () const noexcept |
| Get the count of threads to wait at the barrier. | |
| bool | Wait () |
| Wait at the barrier until all other threads reach this barrier. | |
Barrier synchronization primitive.
A barrier for a group of threads in the source code means any thread must stop at this point and cannot proceed until all other threads reach this barrier.
Thread-safe.
https://en.wikipedia.org/wiki/Barrier_(computer_science)
|
explicit |
Default class constructor.
| threads | - Count of threads to wait at the barrier |
Definition at line 122 of file barrier.cpp.
|
delete |
|
delete |
| CppCommon::Barrier::~Barrier | ( | ) |
Definition at line 133 of file barrier.cpp.
|
noexcept |
Get the count of threads to wait at the barrier.
Definition at line 139 of file barrier.cpp.
| bool CppCommon::Barrier::Wait | ( | ) |
Wait at the barrier until all other threads reach this barrier.
Will block.
Definition at line 141 of file barrier.cpp.