From 653748e3673f515c2ceabe9ef2d57ba087abeb7a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 29 Oct 2024 11:14:51 +0200 Subject: Tweak fix for data race in ad hoc member state when group is postponed --- libbuild2/target.ixx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'libbuild2/target.ixx') diff --git a/libbuild2/target.ixx b/libbuild2/target.ixx index 5e24b20..47dff3d 100644 --- a/libbuild2/target.ixx +++ b/libbuild2/target.ixx @@ -294,16 +294,16 @@ namespace build2 // this feels harmless (ad hoc membership cannot be changed during the // execute phase). // - // Note: if the member state is postponed, then the group state may not be - // yet known (see group_action() for details). - // // Note: this test must come first since the member may not be matched and // thus its state set (but it won't be postponed; see opstate::state). // - if (ctx.phase == run_phase::execute && - adhoc_group_member () && - s.state != target_state::postponed) - return true; + if (ctx.phase == run_phase::execute && adhoc_group_member ()) + { + // Note: if the member state is postponed, then the group state may not + // be yet known (see group_action() for details). + // + return s.state != target_state::postponed; + } if (s.state == target_state::group) return true; -- cgit v1.1