Reference documentation for deal.II version 9.0.0
|
#include <deal.II/base/thread_management.h>
Public Member Functions | |
void | signal () const |
void | broadcast () const |
void | wait (DummyThreadMutex &) const |
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 synchronization 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 mutexes 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.
Definition at line 144 of file thread_management.h.
|
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 152 of file thread_management.h.
|
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 159 of file thread_management.h.
|
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 168 of file thread_management.h.