diff --git a/libs/pika/execution/include/pika/execution/algorithms/sync_wait.hpp b/libs/pika/execution/include/pika/execution/algorithms/sync_wait.hpp index ca6b8198e..e87970404 100644 --- a/libs/pika/execution/include/pika/execution/algorithms/sync_wait.hpp +++ b/libs/pika/execution/include/pika/execution/algorithms/sync_wait.hpp @@ -140,11 +140,8 @@ namespace pika::sync_wait_detail { void wait() { - if (!set_called) - { - std::unique_lock l(mtx); - cond_var.wait(l, [&] { return set_called.load(); }); - } + std::unique_lock l(mtx); + cond_var.wait(l, [&] { return set_called.load(); }); } auto get_value()