From 88f0780e34116c0441a8d8c58b8a8fd9fde4b1f5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 25 Jan 2017 15:41:44 +0200 Subject: Add model mutex, make var_pool const by default --- build2/config/utility.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'build2/config/utility.cxx') diff --git a/build2/config/utility.cxx b/build2/config/utility.cxx index 7a3fa9c..7db4555 100644 --- a/build2/config/utility.cxx +++ b/build2/config/utility.cxx @@ -72,9 +72,10 @@ namespace build2 // any original values, they will be "visible"; see find_override() for // details. // + const variable& vns (var_pool.rw (r).insert (ns)); for (scope* s (&r); s != nullptr; s = s->parent_scope ()) { - for (auto p (s->vars.find_namespace (ns)); + for (auto p (s->vars.find_namespace (vns)); p.first != p.second; ++p.first) { @@ -92,30 +93,30 @@ namespace build2 } bool - unconfigured (scope& root, const string& ns) + unconfigured (scope& rs, const string& ns) { // Note: not overridable. // - const variable& var (var_pool.insert (ns + ".configured")); + const variable& var (var_pool.rw (rs).insert (ns + ".configured")); if (current_mif->id == configure_id) - save_variable (root, var); + save_variable (rs, var); - auto l (root[var]); // Include inherited values. + auto l (rs[var]); // Include inherited values. return l && !cast (l); } bool - unconfigured (scope& root, const string& ns, bool v) + unconfigured (scope& rs, const string& ns, bool v) { // Note: not overridable. // - const variable& var (var_pool.insert (ns + ".configured")); + const variable& var (var_pool.rw (rs).insert (ns + ".configured")); if (current_mif->id == configure_id) - save_variable (root, var); + save_variable (rs, var); - value& x (root.assign (var)); + value& x (rs.assign (var)); if (x.null || cast (x) != !v) { -- cgit v1.1