diff --git a/dataflow_cpp/include/embb/dataflow/internal/action.h b/dataflow_cpp/include/embb/dataflow/internal/action.h index 2b85680..dba3ca8 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/action.h +++ b/dataflow_cpp/include/embb/dataflow/internal/action.h @@ -39,29 +39,22 @@ namespace internal { class Action { public: - Action() : node_(NULL), clock_(0), pending_(0) {} - Action(Node * node, int clock) : node_(node), clock_(clock), pending_(2) {} + Action() : node_(NULL), clock_(0) {} + Action(Node * node, int clock) : node_(node), clock_(clock) {} void RunSequential() { - pending_ = 1; node_->Run(clock_); - pending_ = 0; } void RunMTAPI(embb::tasks::TaskContext & /*context*/) { - pending_ = 1; node_->Run(clock_); - pending_ = 0; } - bool IsPending() const { return pending_ > 0; } - int GetClock() const { return clock_; } private: Node * node_; int clock_; - volatile int pending_; }; } // namespace internal diff --git a/dataflow_cpp/include/embb/dataflow/internal/source.h b/dataflow_cpp/include/embb/dataflow/internal/source.h index 72f198b..af9de28 100644 --- a/dataflow_cpp/include/embb/dataflow/internal/source.h +++ b/dataflow_cpp/include/embb/dataflow/internal/source.h @@ -27,6 +27,8 @@ #ifndef EMBB_DATAFLOW_INTERNAL_SOURCE_H_ #define EMBB_DATAFLOW_INTERNAL_SOURCE_H_ +#include + #include #include #include @@ -88,7 +90,7 @@ class Source< Slices, Outputs > private: OutputsType outputs_; ExecutorType executor_; - volatile bool not_done_; + embb::base::Atomic not_done_; }; } // namespace internal