Dv::Thread::Barrier Class Reference

A simple Barrier class using posix barriers. More...

#include <barrier.h>

List of all members.

Public Member Functions

 Barrier (size_t n_threads)
 Constructor.
virtual ~Barrier ()
 Destructor.
void wait ()
 Wait for the Barrier.

Private Member Functions

 Barrier (const Barrier &)
Barrieroperator= (const Barrier &)

Private Attributes

pthread_t creator_
void * barrier_

Detailed Description

A simple Barrier class using posix barriers.

Note that in the present version, a Barrier can only be used once.

See also:
Dv::Thread::Thread

Constructor & Destructor Documentation

Dv::Thread::Barrier::Barrier ( size_t  n_threads  ) 

Constructor.

Parameters:
n_threads how many threads will have to wait on this barrier before it comes down.
virtual Dv::Thread::Barrier::~Barrier (  )  [virtual]

Destructor.

Dv::Thread::Barrier::Barrier ( const Barrier  )  [private]

Member Function Documentation

void Dv::Thread::Barrier::wait (  ) 

Wait for the Barrier.

This function returns only when exactly n_threads have performed a wait on this barrier

See also:
Dv::Thread::Barrier::Barrier
Barrier& Dv::Thread::Barrier::operator= ( const Barrier  )  [private]

Member Data Documentation

pthread_t Dv::Thread::Barrier::creator_ [private]

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

dvthread-0.13.4 [11 December, 2009]