From ebc6dcfe9e7eb7aeddeff808c1c0498508183263 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 28 Oct 2024 14:07:19 +0200 Subject: Fix data race in ad hoc member state when group is postponed --- libbuild2/target.hxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libbuild2/target.hxx') 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. -- cgit v1.1