Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making sure any function object passed to dataflow is released after being invoked #2963

Merged
merged 1 commit into from Oct 17, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions hpx/lcos/dataflow.hpp
Expand Up @@ -133,8 +133,10 @@ namespace hpx { namespace lcos { namespace detail
void execute(std::false_type, Futures&& futures)
{
try {
Func func = std::move(func_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this temporary really necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do the same in the future shared state. Just wanted to mirror what's there.


result_type res =
util::invoke_fused(func_, std::move(futures));
util::invoke_fused(std::move(func), std::move(futures));

this->set_data(std::move(res));
}
Expand All @@ -149,7 +151,9 @@ namespace hpx { namespace lcos { namespace detail
void execute(std::true_type, Futures&& futures)
{
try {
util::invoke_fused(func_, std::move(futures));
Func func = std::move(func_);

util::invoke_fused(std::move(func), std::move(futures));

this->set_data(util::unused_type());
}
Expand Down