Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | List of all members
Threads::DummyThreadCondition Class Reference

#include <thread_management.h>

Public Member Functions

void signal () const
 
void broadcast () const
 
void wait (DummyThreadMutex &) const
 

Detailed Description

This class is used in single threaded mode instead of a class implementing real condition variable semantics. It allows to write programs such that they start new threads and/or lock objects in multithreading mode, and use dummy thread management and synchronisation classes instead when running in single-thread mode. Specifically, the new_thread functions only call the function but wait for it to return instead of running in on another thread, and the mutices do nothing really. The only reason to provide such a function is that the program can be compiled both in MT and non-MT mode without difference.

In this particular case, just as with mutexes, the functions do nothing, and by this provide the same semantics of condition variables as in multi-threaded mode.

Author
Wolfgang Bangerth, 2003

Definition at line 174 of file thread_management.h.

Member Function Documentation

void Threads::DummyThreadCondition::signal ( ) const
inline

Signal to a single listener that a condition has been met, i.e. that some data will now be available. Since in single threaded mode, this function of course does nothing.

Definition at line 186 of file thread_management.h.

void Threads::DummyThreadCondition::broadcast ( ) const
inline

Signal to multiple listener that a condition has been met, i.e. that some data will now be available. Since in single threaded mode, this function of course does nothing.

Definition at line 197 of file thread_management.h.

void Threads::DummyThreadCondition::wait ( DummyThreadMutex ) const
inline

Wait for the condition to be signalled. Signal variables need to be guarded by a mutex which needs to be given to this function as an argument, see the man page of posix_cond_wait for a description of the mechanisms. Since in single threaded mode, this function of course does nothing, but returns immediately.

Definition at line 213 of file thread_management.h.


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