aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/target.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/target.cxx')
-rw-r--r--libbuild2/target.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/libbuild2/target.cxx b/libbuild2/target.cxx
index fb47b6d..b4c3968 100644
--- a/libbuild2/target.cxx
+++ b/libbuild2/target.cxx
@@ -1004,15 +1004,19 @@ namespace build2
case run_phase::load: break;
case run_phase::match:
{
- // Similar logic to matched_state_impl().
+ // Similar logic to target::matched().
//
const opstate& s (state[action () /* inner */]);
- // Note: already synchronized.
- size_t c (s.task_count.load (memory_order_relaxed));
+ // Note: use acquire for group_state().
+ //
+ size_t c (s.task_count.load (memory_order_acquire));
size_t b (ctx.count_base ()); // Note: cannot do (c - b)!
- if (c != (b + offset_applied) && c != (b + offset_executed))
+ if (!(c == (b + offset_applied) ||
+ c == (b + offset_executed) ||
+ (c >= (b + offset_busy) &&
+ s.match_extra.cur_options_.load (memory_order_relaxed) != 0)))
break;
}
// Fall through.