ITK  4.1.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
itk::Barrier Class Reference

#include <itkBarrier.h>

+ Inheritance diagram for itk::Barrier:
+ Collaboration diagram for itk::Barrier:

List of all members.

Public Types

typedef SmartPointer< const SelfConstPointer
typedef SmartPointer< SelfPointer
typedef Barrier Self
typedef LightObject Superclass

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother (void) const
virtual const char * GetNameOfClass () const
void Initialize (unsigned int)
void Wait ()

Static Public Member Functions

static Pointer New ()

Private Member Functions

 Barrier ()
 ~Barrier ()

Private Attributes

ConditionVariable::Pointer m_ConditionVariable
SimpleMutexLock m_Mutex
unsigned int m_NumberArrived
unsigned int m_NumberExpected

Detailed Description

Standard barrier class implementation for synchronizing the execution of threads.

A barrier class is used to synchronize threaded execution by allowing threads to block until each has reached a desired state. As each thread enters the barrier it blocks. When all threads have entered the barrier, all released and continue to execute.

A thread enters the barrier by calling Wait() on the barrier class. To set up a barrier class, call Initialize(n) where n is the number of waiting threads that will trigger a release of the barrier.

Definition at line 41 of file itkBarrier.h.


Member Typedef Documentation

Reimplemented from itk::LightObject.

Definition at line 50 of file itkBarrier.h.

Reimplemented from itk::LightObject.

Definition at line 49 of file itkBarrier.h.

Standard class typedefs.

Reimplemented from itk::LightObject.

Definition at line 47 of file itkBarrier.h.

Definition at line 48 of file itkBarrier.h.


Constructor & Destructor Documentation

itk::Barrier::Barrier ( ) [private]
itk::Barrier::~Barrier ( ) [private]

Member Function Documentation

virtual::itk::LightObject::Pointer itk::Barrier::CreateAnother ( void  ) const [virtual]

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::LightObject.

virtual const char* itk::Barrier::GetNameOfClass ( ) const [virtual]

Run-time type information (and related methods).

Reimplemented from itk::LightObject.

void itk::Barrier::Initialize ( unsigned  int)

Creates a new system variable used to implement the barrier. The argument to this method is the number of threads that must Wait() on the barrier before it is cleared.

static Pointer itk::Barrier::New ( ) [static]

Method for creation through the object factory.

Reimplemented from itk::LightObject.

A thread calling this method waits until m_NumberOfThreads have called Wait() on the barrier. When the final expected thread calls Wait(), all threads are released.


Member Data Documentation

Definition at line 72 of file itkBarrier.h.

Definition at line 74 of file itkBarrier.h.

unsigned int itk::Barrier::m_NumberArrived [private]

Definition at line 73 of file itkBarrier.h.

unsigned int itk::Barrier::m_NumberExpected [private]

Definition at line 76 of file itkBarrier.h.


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