Skip to content

Commit

Permalink
Update SeriesWork (#149)
Browse files Browse the repository at this point in the history
* add Workflow::unset_last_task()

* fix comments

Co-authored-by: XieHan <[email protected]>
  • Loading branch information
Barenboim and Barenboim authored Nov 9, 2020
1 parent dd8053b commit b2ebc55
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/factory/WFGraphTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ WFGraphTask::~WFGraphTask()
for (i = 0; i < this->parallel->size(); i++)
{
series = const_cast<SeriesWork *>(this->parallel->series_at(i));
series->set_last_task(new WFGenericTask);
series->unset_last_task();
}

this->parallel->dismiss();
Expand Down
4 changes: 3 additions & 1 deletion src/factory/Workflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class SeriesWork
}

public:
/* pop() and set_task_task() are intended for framework providers only. */
/* The next 3 methods are intended for task implementations only. */
SubTask *pop();

void set_last_task(SubTask *last)
Expand All @@ -114,6 +114,8 @@ class SeriesWork
this->last = last;
}

void unset_last_task() { this->last = NULL; }

protected:
void *context;
series_callback_t callback;
Expand Down

0 comments on commit b2ebc55

Please sign in to comment.