Barrier synchronization primitive.
More...
#include <barrier.h>
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)
Definition at line 26 of file barrier.h.
◆ Barrier() [1/3]
CppBenchmark::Barrier::Barrier |
( |
int |
threads | ) |
|
|
explicitnoexcept |
Default class constructor.
- Parameters
-
threads | - Count of threads to wait at the barrier |
Definition at line 15 of file barrier.cpp.
◆ Barrier() [2/3]
CppBenchmark::Barrier::Barrier |
( |
const Barrier & |
| ) |
|
|
delete |
◆ Barrier() [3/3]
CppBenchmark::Barrier::Barrier |
( |
Barrier && |
| ) |
|
|
delete |
◆ ~Barrier()
CppBenchmark::Barrier::~Barrier |
( |
| ) |
|
|
default |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Wait()
bool CppBenchmark::Barrier::Wait |
( |
| ) |
|
|
noexcept |
Wait at the barrier until all other threads reach this barrier.
Will block.
- Returns
- 'true' for the last thread that reach barrier, 'false' for each of the remaining threads
Definition at line 20 of file barrier.cpp.
The documentation for this class was generated from the following files: