diff options
Diffstat (limited to 'libbuild2/context.ixx')
-rw-r--r-- | libbuild2/context.ixx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libbuild2/context.ixx b/libbuild2/context.ixx index 73601d4..6c8c428 100644 --- a/libbuild2/context.ixx +++ b/libbuild2/context.ixx @@ -31,7 +31,7 @@ namespace build2 } inline wait_guard:: - wait_guard (wait_guard&& x) + wait_guard (wait_guard&& x) noexcept : ctx (x.ctx), start_count (x.start_count), task_count (x.task_count), @@ -41,7 +41,7 @@ namespace build2 } inline wait_guard& wait_guard:: - operator= (wait_guard&& x) + operator= (wait_guard&& x) noexcept { if (&x != this) { @@ -56,12 +56,8 @@ namespace build2 inline void wait_guard:: wait () { - if (task_count->load (memory_order_acquire) > start_count) - { - phase_unlock u (*ctx, phase); - ctx->sched.wait (start_count, *task_count); - } - + phase_unlock u (phase ? ctx : nullptr, true /* delay */); + ctx->sched->wait (start_count, *task_count, u); task_count = nullptr; } } |