Skip to content

Commit

Permalink
Fix a bug in async().
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadden committed Sep 16, 2020
1 parent b063d44 commit 2b29487
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/alia/signals/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,8 @@ template<class Value>
void
reset(apply_result_data<Value>& data)
{
if (data.status != apply_status::UNCOMPUTED)
{
++data.version;
data.status = apply_status::UNCOMPUTED;
}
++data.version;
data.status = apply_status::UNCOMPUTED;
}

template<class Value>
Expand Down
9 changes: 3 additions & 6 deletions src/alia/signals/async.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ template<class Value>
void
reset(async_operation_data<Value>& data)
{
if (data.status != async_status::UNREADY)
{
++data.version;
data.status = async_status::UNREADY;
}
++data.version;
data.status = async_status::UNREADY;
}

template<class Value>
Expand Down Expand Up @@ -105,7 +102,6 @@ process_async_args(
template<class Result>
struct async_reporter
{

};

template<class Result, class Context, class Launcher, class... Args>
Expand Down Expand Up @@ -141,6 +137,7 @@ async(Context ctx, Launcher launcher, Args const&... args)
try
{
launcher(ctx, report_result, read_signal(args)...);
data.status = async_status::LAUNCHED;
}
catch (...)
{
Expand Down

0 comments on commit 2b29487

Please sign in to comment.