Reference documentation for deal.II version 8.4.1

#include <deal.II/base/thread_management.h>

Public Member Functions

void join () const

bool joinable () const

RT return_value ()

DeclExceptionMsg (ExcNoTask,"The current object is not associated with a task that ""can be joined. It may have been detached, or you ""may have already joined it in the past.")

Detailed Description

Describes one task object based on the Threading Building Blocks' Task. Note that the call to join() must be executed on the same thread as the call to the constructor. Otherwise, there might be a deadlock. In other words, a Task object should never passed on to another task for calling the join() method.

Definition at line 2663 of file thread_management.h.

Constructor & Destructor Documentation

template<typename RT = void>
inline

Construct a task object given a function object to execute on the task, and then schedule this function for execution.

Postcondition
Using this constructor automatically makes the task object joinable().

Definition at line 2956 of file thread_management.h.

template<typename RT = void>
inline

Copy constructor.

Postcondition
Using this constructor automatically makes the task object joinable().

Definition at line 2971 of file thread_management.h.

template<typename RT = void>
inline

Default constructor. You can't do much with a task object constructed this way, except for assigning it a task object that holds data created by the Threads::new_task() functions.

Postcondition
Using this constructor leaves the object in an unjoinable state, i.e., joinable() will return false.

Definition at line 2985 of file thread_management.h.

Member Function Documentation

template<typename RT = void>
inline

Join the task represented by this object, i.e. wait for it to finish.

A task can be joined multiple times (while the first join() operation may block until the task has completed running, all successive attempts to join will return immediately).

Precondition
You can't call this function if you have used the default constructor of this class and have not assigned a task object to it. In other words, the function joinable() must return true.

Definition at line 2998 of file thread_management.h.

template<typename RT = void>
inline

Return whether the current object can be joined. You can join a task object once a task (typically created with Threads::new_task()) has actually been assigned to it. On the other hand, the function returns false if the object has been default constructed.

A task can be joined multiple times (while the first join() operation may block until the task has completed running, all successive attempts to join will return immediately). Consequently, if this function returns true, it will continue to return true until the task object it reports on is assigned to from another object.

Definition at line 3016 of file thread_management.h.

template<typename RT = void>
inline

Get the return value of the function of the task. Since this is only available once the task finishes, this implicitly also calls join(). You can call this function multiple times as long as the object refers to the same task, and expect to get the same return value every time.

Precondition
You can't call this function if you have used the default constructor of this class and have not assigned a task object to it. In other words, the function joinable() must return true.

Definition at line 3033 of file thread_management.h.

template<typename RT = void>
inline

Check for equality of task objects. Since objects of this class store an implicit pointer to an object that exists exactly once for each task, the check is simply to compare these pointers.

Definition at line 3045 of file thread_management.h.

Member Data Documentation

template<typename RT = void>