aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/context.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-05-12 10:46:21 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-05-12 16:30:12 +0200
commit88379eedeae654391711d8cdda17dfc2be6367ef (patch)
tree966ee03369b51013021600a2beea8334962ab2ec /libbuild2/context.ixx
parent8b858c642ccab43050dcff2d8f98db469ac6dc1b (diff)
Keep phase locked while working own queue
Diffstat (limited to 'libbuild2/context.ixx')
-rw-r--r--libbuild2/context.ixx8
1 files changed, 2 insertions, 6 deletions
diff --git a/libbuild2/context.ixx b/libbuild2/context.ixx
index 73601d4..4f86c28 100644
--- a/libbuild2/context.ixx
+++ b/libbuild2/context.ixx
@@ -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 (*ctx, phase, true /* delay */);
+ ctx->sched.wait (start_count, *task_count, u);
task_count = nullptr;
}
}