aboutsummaryrefslogtreecommitdiff
path: root/build2/algorithm.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-07-28 09:54:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-07-28 09:54:39 +0200
commiteace8edd98fe684e4631d9afb9be76ad3081f746 (patch)
treeec0e701629b16095a68564d662e7d159dfdf2ef9 /build2/algorithm.cxx
parent5e417ea840d51c20295f8772e8b4655065071b7d (diff)
Fix bug in target_count logic
Diffstat (limited to 'build2/algorithm.cxx')
-rw-r--r--build2/algorithm.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/build2/algorithm.cxx b/build2/algorithm.cxx
index e702836..fa9787b 100644
--- a/build2/algorithm.cxx
+++ b/build2/algorithm.cxx
@@ -840,7 +840,13 @@ namespace build2
ts = t.recipe_ (a, t);
- target_count.fetch_sub (1, memory_order_relaxed);
+ // Decrement the target count (see target::recipe() for details).
+ //
+ {
+ recipe_function** f (t.recipe_.target<recipe_function*> ());
+ if (f == nullptr || *f != &group_action)
+ target_count.fetch_sub (1, memory_order_relaxed);
+ }
// See the recipe documentation for details on what's going on here.
// Note that if the result is group, then the group's state can be