From 88379eedeae654391711d8cdda17dfc2be6367ef Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 12 May 2021 10:46:21 +0200 Subject: Keep phase locked while working own queue --- libbuild2/context.ixx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'libbuild2/context.ixx') 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; } } -- cgit v1.1