From f24909d04c3e0db53e7bb58ba8a2dc3eca055f72 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 25 May 2018 14:01:59 +0200 Subject: Fix target locking race in search_library() --- build2/cc/common.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) 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; } -- cgit v1.1