Reference documentation for deal.II version Git 350fd17bfc 2020-02-26 19:16:00 +0100
\(\newcommand{\vcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\vcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Private Attributes | List of all members
Threads::PosixThreadBarrier Class Reference

#include <deal.II/base/thread_management.h>

Public Member Functions

 PosixThreadBarrier (const unsigned int count, const char *name=nullptr, void *arg=nullptr)
 ~PosixThreadBarrier ()
int wait ()

Private Attributes

pthread_barrier_t barrier

Detailed Description

Implementation of a thread barrier class, based on the POSIX thread functions. POSIX barriers are a relatively new feature and are not supported on all systems.

If the configuration detected the absence of these functions, then barriers will not be available, and creating objects of this class will result in an exception been thrown unless the count given for the parties waiting for the barrier is equal to one (as in this case waiting for the barrier is a no-operation, and we can dispense with the POSIX functions at all). The rest of the threading functionality will be available in its full extent, though, even if POSIX barriers are not available.

This class is deprecated. It is easily possible to implement its functionality with the facilities provided by C++11.
Wolfgang Bangerth, 2002

Definition at line 240 of file thread_management.h.

Constructor & Destructor Documentation

◆ PosixThreadBarrier()

Threads::PosixThreadBarrier::PosixThreadBarrier ( const unsigned int  count,
const char *  name = nullptr,
void *  arg = nullptr 

Constructor. Initialize the underlying POSIX barrier data structure.

Definition at line 155 of file

◆ ~PosixThreadBarrier()

Threads::PosixThreadBarrier::~PosixThreadBarrier ( )

Destructor. Release all resources.

Definition at line 185 of file

Member Function Documentation

◆ wait()

int Threads::PosixThreadBarrier::wait ( )

Wait for all threads to reach this point. The return value is zero for all participating threads except for one, for which the return value is some non-zero value. The operating system picks the special thread by some not further known method.

Definition at line 201 of file

Member Data Documentation

◆ barrier

pthread_barrier_t Threads::PosixThreadBarrier::barrier

Data object storing the POSIX data which we need to call the POSIX functions.

Definition at line 270 of file thread_management.h.

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