diff options
Diffstat (limited to 'build2/target.cxx')
-rw-r--r-- | build2/target.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/build2/target.cxx b/build2/target.cxx index 64b376c..81d613f 100644 --- a/build2/target.cxx +++ b/build2/target.cxx @@ -613,8 +613,9 @@ namespace build2 out_base.normalize (); // In our world modifications to the scope structure during search & - // match should be "pure" in the sense that they should not affect any - // existing targets that have already been searched & matched. + // match should be "pure append" in the sense that they should not + // affect any existing targets that have already been searched & + // matched. // // A straightforward way to enforce this is to not allow any existing // targets to be inside any newly created scopes (except, perhaps for @@ -625,6 +626,10 @@ namespace build2 // not a subdirectory of out_base. So for now we just assume that this // is so. And so it is. + // Relock for exclusive access. + // + rlock rl (model_lock); + pair<scope&, scope*> sp (switch_scope (*s.root_scope (), out_base)); if (sp.second != nullptr) // Ignore scopes out of any project. @@ -638,7 +643,7 @@ namespace build2 { l5 ([&]{trace << "loading buildfile " << bf << " for " << pk;}); - if (source_once (bf, root, base, root)) + if (source_once (root, base, bf, root)) { // If we loaded the buildfile, examine the target again. // |