diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-06 08:29:30 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-02-06 08:29:30 +0200 |
commit | f10be65c39c18668df31c8680569a6417ef3ae06 (patch) | |
tree | 11d0f2887d1dd3b3b35f039f4b7bd39835dcaba5 /build2/algorithm.ixx | |
parent | 1d738c03d8cd7eae151f9e4ba4fded986373e6bb (diff) |
Increment targe_count for inner operations only
Diffstat (limited to 'build2/algorithm.ixx')
-rw-r--r-- | build2/algorithm.ixx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/build2/algorithm.ixx b/build2/algorithm.ixx index 9baa650..7cad7ff 100644 --- a/build2/algorithm.ixx +++ b/build2/algorithm.ixx @@ -306,13 +306,18 @@ namespace build2 // (which are not executed). Plus, group action means real recipe is in // the group so this also feels right conceptually. // - // Note that we will increment this count twice for the same target if - // we have non-noop recipes for both inner and outer operations. While - // not ideal, the alternative (trying to "merge" the count keeping track + // We also avoid increment this count twice for the same target if we + // have both the inner and outer operations. In our model the outer + // operation is either noop or it must delegate to the inner. While it's + // possible the inner is noop while the outer is not, it is not very + // likely. The alternative (trying to "merge" the count keeping track of // whether inner and/or outer is noop) gets hairy rather quickly. // - if (f == nullptr || *f != &group_action) - target_count.fetch_add (1, memory_order_relaxed); + if (l.action.inner ()) + { + if (f == nullptr || *f != &group_action) + target_count.fetch_add (1, memory_order_relaxed); + } } } |