aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-25 14:01:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-25 14:01:59 +0200
commitf24909d04c3e0db53e7bb58ba8a2dc3eca055f72 (patch)
tree8e3f03839e64afab1dd2e176a770bf79ad3865fe
parentd69e09acb570030a56566739569867139f5d1f4b (diff)
Fix target locking race in search_library()
-rw-r--r--build2/cc/common.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/build2/cc/common.cxx b/build2/cc/common.cxx
index 3c8b115..0778acf 100644
--- a/build2/cc/common.cxx
+++ b/build2/cc/common.cxx
@@ -882,6 +882,14 @@ namespace build2
}
}
+ // If we have the lock (meaning this is the first time), set the
+ // traget's recipe to noop. Failed that we will keep re-locking it,
+ // updating its members, etc.
+ //
+ if (al) match_recipe (al, noop_recipe);
+ if (sl) match_recipe (sl, noop_recipe);
+ if (ll) match_recipe (ll, noop_recipe);
+
return r;
}