NeoPZ
TPZTaskGroup.h
Go to the documentation of this file.
1 /*
2  * File: TPZTaskGroup.h
3  * Author: thiago
4  *
5  * Created on 1 de Agosto de 2018, 17:28
6  */
7 
8 #ifndef TPZTASKGROUP_H
9 #define TPZTASKGROUP_H
10 
11 #include "tpzautopointer.h"
12 #include "TPZTask.h"
13 #include <mutex>
14 #include "pzstack.h"
15 #include <set>
16 
17 class TPZTaskGroup {
18 public:
19  TPZTaskGroup();
20  TPZTaskGroup(const TPZTaskGroup& orig);
21  void Wait();
22  long unsigned int Active();
23  virtual ~TPZTaskGroup();
24 
25  friend class TPZTask;
26 private:
27  void Notify(TPZTask *task);
28  void RegisterTask(TPZTask *task);
30  std::condition_variable fObservers;
31  std::set<TPZTask*> fPendingTasks;
32 };
33 
34 #endif /* TPZTASKGROUP_H */
35 
pthread_mutex_t mutex
Semaphore which controls multiple threads.
std::condition_variable fObservers
Definition: TPZTaskGroup.h:30
long unsigned int Active()
Helper class for ordering the tasks that the user have requested.
Definition: TPZTask.h:18
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
A simple stack.
std::mutex fMutex
Definition: TPZTaskGroup.h:29
std::set< TPZTask * > fPendingTasks
Definition: TPZTaskGroup.h:31
void Notify(TPZTask *task)
virtual ~TPZTaskGroup()
void RegisterTask(TPZTask *task)