aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/rule.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-05-23 09:23:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-05-29 10:21:12 +0200
commite05f7c7383cc48823bd408c0bc5187191a9a1c48 (patch)
tree024bb9c3be9c876b8822388baf1622cad03d7563 /libbuild2/rule.hxx
parent349b34108752e2fcf1ead648ffec8e5acfe4a91c (diff)
Explicit group: static members
Diffstat (limited to 'libbuild2/rule.hxx')
-rw-r--r--libbuild2/rule.hxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/libbuild2/rule.hxx b/libbuild2/rule.hxx
index 913c597..b89821b 100644
--- a/libbuild2/rule.hxx
+++ b/libbuild2/rule.hxx
@@ -252,6 +252,16 @@ namespace build2
// The default implementation forwards to the pattern's match() if there
// is a pattern and returns true otherwise.
//
+ // Note also that in case of a member of a group-based target, match() is
+ // called on the group while apply() on the member (see match_rule() in
+ // algorithms.cxx for details). This means that match() may be called
+ // without having the target locked and as a result match() should (unless
+ // known to only match a non-group) treat the target as const and only
+ // rely on immutable information (type, name, etc) since the group could
+ // be matched concurrenly. This case can be detected by examining
+ // match_extra::locked (see adhoc_rule_regex_pattern::match() for a
+ // use-case).
+ //
virtual bool
match (action, target&, const string&, match_extra&) const override;
@@ -318,8 +328,10 @@ namespace build2
~adhoc_rule_pattern ();
public:
+ // Note: the adhoc_rule::match() restrictions apply here as well.
+ //
virtual bool
- match (action, target&, const string&, match_extra&) const = 0;
+ match (action, const target&, const string&, match_extra&) const = 0;
virtual void
apply_adhoc_members (action, target&,