Reference documentation for deal.II version 8.5.1
|
#include <deal.II/base/thread_management.h>
Public Member Functions | |
Task (const std_cxx11::function< RT()> &function_object) | |
Task (const Task< RT > &t) | |
Task () | |
void | join () const |
bool | joinable () const |
RT | return_value () |
bool | operator== (const Task &t) const |
Static Public Member Functions | |
static ::ExceptionBase & | ExcNoTask () |
Private Attributes | |
std_cxx11::shared_ptr< internal::TaskDescriptor< RT > > | task_descriptor |
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 2753 of file thread_management.h.
|
inline |
Construct a task object given a function object to execute on the task, and then schedule this function for execution.
Definition at line 3081 of file thread_management.h.
|
inline |
Copy constructor.
Definition at line 3096 of file thread_management.h.
|
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.
Definition at line 3110 of file thread_management.h.
|
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).
Definition at line 3123 of file thread_management.h.
|
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 3141 of file thread_management.h.
|
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.
Definition at line 3158 of file thread_management.h.
|
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 3170 of file thread_management.h.
|
private |
Shared pointer to the object representing the task. Boost's shared pointer implementation will make sure that that object lives as long as there is at least one subscriber to it.
Definition at line 3195 of file thread_management.h.