Public Member Functions | Private Attributes

Threads::PosixThreadBarrier Class Reference

List of all members.

Public Member Functions

 PosixThreadBarrier (const unsigned int count, const char *name=0, void *arg=0)
 ~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.

Author:
Wolfgang Bangerth, 2002

Definition at line 499 of file thread_management.h.


Constructor & Destructor Documentation

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

Constructor. Initialize the underlying POSIX barrier data structure.

Threads::PosixThreadBarrier::~PosixThreadBarrier (  )

Destructor. Release all resources.


Member Function Documentation

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.


Member Data Documentation

pthread_barrier_t Threads::PosixThreadBarrier::barrier [private]

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

Definition at line 538 of file thread_management.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:17 by doxygen 1.7.2