Public Member Functions | Private Attributes

Threads::TaskGroup< RT > Class Template Reference

List of all members.

Public Member Functions

TaskGroupoperator+= (const Task< RT > &t)
void join_all () const

Private Attributes

std::list< Task< RT > > tasks

Detailed Description

template<typename RT = void>
class Threads::TaskGroup< RT >

A container for task objects. Allows to add new task objects and wait for them all together. The task objects need to have the same return value for the called function.

Note that the call to join_all() must be executed on the same thread as the calls that add subtasks. Otherwise, there might be a deadlock. In other words, a Task object should never passed on to another task for calling the join() method.

Author:
Wolfgang Bangerth, 2003

Definition at line 5141 of file thread_management.h.


Member Function Documentation

template<typename RT = void>
TaskGroup& Threads::TaskGroup< RT >::operator+= ( const Task< RT > &  t ) [inline]

Add another task object to the collection.

Definition at line 5148 of file thread_management.h.

References Threads::TaskGroup< RT >::tasks.

template<typename RT = void>
void Threads::TaskGroup< RT >::join_all (  ) const [inline]

Wait for all tasks in the collection to finish. It is not a problem if some of them have already been waited for, i.e. you may call this function more than once, and you can also add new task objects between subsequent calls to this function if you want.

Definition at line 5166 of file thread_management.h.

References Threads::TaskGroup< RT >::tasks.

Referenced by WorkStream::internal::IteratorRangeToItemStream< Iterator, ScratchData, CopyData >::IteratorRangeToItemStream().


Member Data Documentation

template<typename RT = void>
std::list<Task<RT> > Threads::TaskGroup< RT >::tasks [private]

List of task objects.

Definition at line 5176 of file thread_management.h.

Referenced by Threads::TaskGroup< RT >::join_all(), and Threads::TaskGroup< RT >::operator+=().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Fri Feb 3 2012 06:04:17 by doxygen 1.7.2