diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-28 14:07:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2024-10-28 14:07:19 +0200 |
commit | ebc6dcfe9e7eb7aeddeff808c1c0498508183263 (patch) | |
tree | 97a2a70cb1fd60f00699a6c8a1f4266ca2b1b02a /libbuild2/target.hxx | |
parent | 4eb1b56b8e0e2451a563c75946a600d875d50e5a (diff) |
Fix data race in ad hoc member state when group is postponed
Diffstat (limited to 'libbuild2/target.hxx')
-rw-r--r-- | libbuild2/target.hxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libbuild2/target.hxx b/libbuild2/target.hxx index b008347..72d6dbc 100644 --- a/libbuild2/target.hxx +++ b/libbuild2/target.hxx @@ -953,10 +953,14 @@ namespace build2 mutable bool recipe_keep; // Keep after execution. bool recipe_group_action; // Recipe is group_action. - // Target state for this operation. Note that it is undetermined until - // a rule is matched and recipe applied (see set_recipe()). + // Target state for this operation. // - target_state state; + // Note that it is undetermined until a rule is matched and recipe + // applied (see set_recipe()). However, we need it to be not postponed + // for ad hoc members that are not matched (see group_state()) so + // initialize it to unknown. + // + target_state state = target_state::unknown; // Set to true (only for the inner action) if this target has been // matched but not executed as a result of the resolve_members() call. |