Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Concurrency::LegacyStdThreadBarrier Class Reference

Implementation of a barrier. More...

Inheritance diagram for Arcane::Concurrency::LegacyStdThreadBarrier:
Collaboration diagram for Arcane::Concurrency::LegacyStdThreadBarrier:

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

Detailed Description

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.

Member Function Documentation

◆ destroy()

void Arcane::Concurrency::LegacyStdThreadBarrier::destroy ( )
inlineoverridevirtual

Destroys the barrier.

Implements Arcane::IThreadBarrier.

Definition at line 119 of file StdThreadImplementation.cc.

◆ init()

void Arcane::Concurrency::LegacyStdThreadBarrier::init ( Integer nb_thread)
inlineoverridevirtual

Initializes the barrier for nb_thread.

Implements Arcane::IThreadBarrier.

Definition at line 113 of file StdThreadImplementation.cc.

◆ wait()

void Arcane::Concurrency::LegacyStdThreadBarrier::wait ( )
inlineoverridevirtual

Blocks and waits until all threads call this method.

Implements Arcane::IThreadBarrier.

Definition at line 126 of file StdThreadImplementation.cc.

Member Data Documentation

◆ m_current_reached

Integer Arcane::Concurrency::LegacyStdThreadBarrier::m_current_reached = 0
private

Definition at line 148 of file StdThreadImplementation.cc.

◆ m_generation

Int32 Arcane::Concurrency::LegacyStdThreadBarrier::m_generation = 0
private

Definition at line 149 of file StdThreadImplementation.cc.

◆ m_nb_thread

Integer Arcane::Concurrency::LegacyStdThreadBarrier::m_nb_thread = 0
private

Definition at line 147 of file StdThreadImplementation.cc.

◆ m_wait

std::condition_variable Arcane::Concurrency::LegacyStdThreadBarrier::m_wait
private

Definition at line 146 of file StdThreadImplementation.cc.

◆ m_wait_mutex

std::mutex Arcane::Concurrency::LegacyStdThreadBarrier::m_wait_mutex
private

Definition at line 145 of file StdThreadImplementation.cc.


The documentation for this class was generated from the following file: