![]() |
Reference documentation for deal.II version 8.1.0
|
#include <thread_management.h>
Public Member Functions | |
Task (const std_cxx1x::function< RT()> &function_object) | |
Task (const Task< RT > &t) | |
Task () | |
void | join () const |
RT | return_value () |
bool | operator== (const Task &t) |
DeclException0 (ExcNoTask) | |
Private Attributes | |
std_cxx1x::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 3953 of file thread_management.h.
|
inline |
Construct a task object given a function object to execute on the task.
Definition at line 4328 of file thread_management.h.
|
inline |
Copy constructor.
Definition at line 4343 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 spawn
functions.
Definition at line 4358 of file thread_management.h.
|
inline |
Join the task represented by this object, i.e. wait for it to finish. 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.
Definition at line 4370 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()
.
Definition at line 4386 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 4402 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 4427 of file thread_management.h.