Public Member Functions | Static Public Member Functions

Threads::DummyBarrier Class Reference

List of all members.

Public Member Functions

 DummyBarrier (const unsigned int count, const char *name=0, void *arg=0)
int wait () const
void dump () const

Static Public Member Functions

::ExceptionBaseExcBarrierSizeNotUseful (int arg1) throw (errortext << "In single-thread mode, other barrier sizes than 1 are not " << "useful. You gave " << arg1 )

Detailed Description

This class is used instead of a true barrier class when not using multithreading. It allows to write programs such that they use the same class names in multithreading and non-MT mode and thus may be compiled with or without thread-support without the need to use conditional compilation. Since a barrier class only makes sense in non-multithread mode if only one thread is to be synchronised (otherwise, the barrier could not be left, since the one thread is waiting for some other part of the program to reach a certain point of execution), the constructor of this class throws an exception if the count argument denoting the number of threads that need to be synchronised is not equal to one.

Author:
Wolfgang Bangerth, 2001

Definition at line 228 of file thread_management.h.


Constructor & Destructor Documentation

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

Constructor. Since barriers are only useful in single-threaded mode if the number of threads to be synchronised is one, this constructor raises an exception if the count argument is one.


Member Function Documentation

int Threads::DummyBarrier::wait (  ) const [inline]

Wait for all threads to reach this point. Since there may only be one thread, return immediately, i.e. this function is a no-op.

Definition at line 253 of file thread_management.h.

void Threads::DummyBarrier::dump (  ) const [inline]

Dump the state of this object. Here: do nothing.

Definition at line 259 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