cheshirekow  v0.1.0
pthreads::Barrier Class Reference

A barrier is an object which synchronizes a fixed number of threads at a specific point. More...

#include <cpp_pthreads/barrier.h>

Public Member Functions

int destroy ()
 destroy the barrier More...
 
int init (unsigned count)
 initialize a barrier for count threads using default attributes More...
 
int init (const Attr< Barrier > &attr, unsigned count)
 initialize a barrier for count threads using the specified attributes More...
 
int wait ()
 called by a thread which wishes to synchronize on the barrier. Will block until count threads are all wait()ing on the barrier More...
 

Private Attributes

pthread_barrier_t m_data
 

Detailed Description

A barrier is an object which synchronizes a fixed number of threads at a specific point.

Note
once initialized, threads that wish to synchronize call wait() on a barrier. Once count threads are waiting on the barrier, they will all be released.

Definition at line 42 of file barrier.h.

Member Function Documentation

int pthreads::Barrier::destroy ( )

destroy the barrier

int pthreads::Barrier::init ( unsigned  count)

initialize a barrier for count threads using default attributes

int pthreads::Barrier::init ( const Attr< Barrier > &  attr,
unsigned  count 
)

initialize a barrier for count threads using the specified attributes

int pthreads::Barrier::wait ( )

called by a thread which wishes to synchronize on the barrier. Will block until count threads are all wait()ing on the barrier

Member Data Documentation

pthread_barrier_t pthreads::Barrier::m_data
private

Definition at line 44 of file barrier.h.


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