Implementation of a barrier. More...
Public Member Functions | |
| void | init (Integer nb_thread) override |
| Initializes the barrier for nb_thread. | |
| void | destroy () override |
| Destroys the barrier. | |
| void | wait () override |
| Blocks and waits until all threads call this method. | |
Private Attributes | |
| std::mutex | m_wait_mutex |
| std::condition_variable | m_wait |
| Integer | m_nb_thread = 0 |
| Integer | m_current_reached = 0 |
| Int32 | m_generation = 0 |
Implementation of a barrier.
This implementation was used before C++20 support when the std::barrier class did not exist.
Definition at line 108 of file StdThreadImplementation.cc.
|
inlineoverridevirtual |
Destroys the barrier.
Implements Arcane::IThreadBarrier.
Definition at line 119 of file StdThreadImplementation.cc.
|
inlineoverridevirtual |
Initializes the barrier for nb_thread.
Implements Arcane::IThreadBarrier.
Definition at line 113 of file StdThreadImplementation.cc.
|
inlineoverridevirtual |
Blocks and waits until all threads call this method.
Implements Arcane::IThreadBarrier.
Definition at line 126 of file StdThreadImplementation.cc.
|
private |
Definition at line 148 of file StdThreadImplementation.cc.
|
private |
Definition at line 149 of file StdThreadImplementation.cc.
|
private |
Definition at line 147 of file StdThreadImplementation.cc.
|
private |
Definition at line 146 of file StdThreadImplementation.cc.
|
private |
Definition at line 145 of file StdThreadImplementation.cc.