Skip to content

Commit

Permalink
Fix race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Pansysk75 authored and hkaiser committed Jul 21, 2023
1 parent b19cb1e commit 681a991
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/core/futures/src/future_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ namespace hpx::lcos::detail {
bool future_data_base<traits::detail::future_data_void>::execute_thread()
{
// we try to directly execute the thread exactly once
if (!runs_child_)
threads::thread_id_ref_type runs_child = runs_child_;
if (!runs_child)
{
return false;
}
Expand All @@ -129,7 +130,6 @@ namespace hpx::lcos::detail {
}

// this thread would block on the future
threads::thread_id_ref_type runs_child = runs_child_;

auto* thrd = get_thread_id_data(runs_child);
HPX_UNUSED(thrd); // might be unused
Expand Down

0 comments on commit 681a991

Please sign in to comment.