Skip to content

Commit 03f7337

Browse files
updated executor
1 parent cb9713b commit 03f7337

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

taskflow/core/executor.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ class Executor {
231231
void _invoke_static_work(unsigned, Node*);
232232
void _invoke_dynamic_work(unsigned, Node*, Subflow&);
233233
void _init_module_node(Node*);
234-
void _tear_down_topology(Topology&);
234+
void _tear_down_topology(Topology*);
235235
};
236236

237237
// Constructor
@@ -682,7 +682,7 @@ inline void Executor::_invoke(unsigned me, Node* node) {
682682
if(num_successors == 0) {
683683
if(--(node->_topology->_num_sinks) == 0) {
684684
if(_workers.size() > 0) { // finishing this topology
685-
_tear_down_topology(*node->_topology);
685+
_tear_down_topology(node->_topology);
686686
}
687687
}
688688
}
@@ -742,22 +742,22 @@ std::future<void> Executor::run_until(Taskflow& f, P&& pred) {
742742
}
743743

744744
// Function: _tear_down_topology
745-
inline void Executor::_tear_down_topology(Topology& tpg) {
745+
inline void Executor::_tear_down_topology(Topology* tpg) {
746746

747-
auto &f = tpg._taskflow;
747+
auto &f = tpg->_taskflow;
748748

749749
//assert(&tpg == &(f._topologies.front()));
750750

751751
// case 1: we still need to run the topology again
752-
if(!std::invoke(tpg._pred)) {
753-
tpg._recover_num_sinks();
754-
_schedule(tpg._sources);
752+
if(!std::invoke(tpg->_pred)) {
753+
tpg->_recover_num_sinks();
754+
_schedule(tpg->_sources);
755755
}
756756
// case 2: the final run of this topology
757757
else {
758758

759-
if(tpg._call != nullptr) {
760-
std::invoke(tpg._call);
759+
if(tpg->_call != nullptr) {
760+
std::invoke(tpg->_call);
761761
}
762762

763763
f._mtx.lock();
@@ -766,7 +766,7 @@ inline void Executor::_tear_down_topology(Topology& tpg) {
766766
if(f._topologies.size() > 1) {
767767

768768
// Set the promise
769-
tpg._promise.set_value();
769+
tpg->_promise.set_value();
770770
f._topologies.pop_front();
771771
f._mtx.unlock();
772772

@@ -782,7 +782,7 @@ inline void Executor::_tear_down_topology(Topology& tpg) {
782782
assert(f._topologies.size() == 1);
783783
// Need to back up the promise first here becuz taskflow might be
784784
// destroy before taskflow leaves
785-
auto p {std::move(tpg._promise)};
785+
auto p {std::move(tpg->_promise)};
786786

787787
f._topologies.pop_front();
788788

0 commit comments

Comments
 (0)