TDME2 1.9.121
Public Member Functions | Private Attributes | List of all members
Barrier Class Reference

Barrier implementation. More...

#include <tdme/os/threading/Barrier.h>

Collaboration diagram for Barrier:
Collaboration graph

Public Member Functions

 Barrier (const string &name, const unsigned int count)
 Public constructor. More...
 
 ~Barrier ()
 Destroys the barrier. More...
 
bool wait ()
 Waits on barrier. More...
 

Private Attributes

string name
 
unsigned int count
 
volatile unsigned int entered
 
volatile unsigned int exited
 
Mutex m
 
Condition c
 

Detailed Description

Barrier implementation.

Author
Andreas Drewke

Definition at line 21 of file Barrier.h.

Constructor & Destructor Documentation

◆ Barrier()

Barrier ( const string &  name,
const unsigned int  count 
)

Public constructor.

Parameters
namename
countNumber of threads that need to "wait" on barrier to complete barrier

Definition at line 12 of file Barrier.cpp.

◆ ~Barrier()

~Barrier ( )

Destroys the barrier.

Definition at line 17 of file Barrier.cpp.

Member Function Documentation

◆ wait()

bool wait ( )

Waits on barrier.

Returns
bool if caller thread is selected for updating shared data

Definition at line 31 of file Barrier.cpp.

Member Data Documentation

◆ c

Condition c
private

Definition at line 47 of file Barrier.h.

◆ count

unsigned int count
private

Definition at line 43 of file Barrier.h.

◆ entered

volatile unsigned int entered
private

Definition at line 44 of file Barrier.h.

◆ exited

volatile unsigned int exited
private

Definition at line 45 of file Barrier.h.

◆ m

Mutex m
private

Definition at line 46 of file Barrier.h.

◆ name

string name
private

Definition at line 42 of file Barrier.h.


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