Commit d06a82f0 by Winter

dataflow_cpp: removed debug code from Action, changed done sync to atomics

parent 2f7e8112
......@@ -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
......
......@@ -27,6 +27,8 @@
#ifndef EMBB_DATAFLOW_INTERNAL_SOURCE_H_
#define EMBB_DATAFLOW_INTERNAL_SOURCE_H_
#include <embb/base/atomic.h>
#include <embb/dataflow/internal/node.h>
#include <embb/dataflow/internal/outputs.h>
#include <embb/dataflow/internal/source_executor.h>
......@@ -88,7 +90,7 @@ class Source< Slices, Outputs<Slices, O1, O2, O3, O4, O5> >
private:
OutputsType outputs_;
ExecutorType executor_;
volatile bool not_done_;
embb::base::Atomic<bool> not_done_;
};
} // namespace internal
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment