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/module.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'build2/module.cxx') diff --git a/build2/module.cxx b/build2/module.cxx index c2f907f..031ae45 100644 --- a/build2/module.cxx +++ b/build2/module.cxx @@ -15,7 +15,7 @@ namespace build2 available_module_map builtin_modules; void - boot_module (const string& name, scope& rs, const location& loc) + boot_module (scope& rs, const string& name, const location& loc) { // First see if this modules has already been loaded for this project. // @@ -50,9 +50,9 @@ namespace build2 } bool - load_module (const string& name, - scope& rs, + load_module (scope& rs, scope& bs, + const string& name, const location& loc, bool opt, const variable_map& hints) @@ -100,10 +100,13 @@ namespace build2 bool c (l && i->second.init (rs, bs, loc, i->second.module, f, opt, hints)); - const variable& lv (var_pool.insert (name + ".loaded", - variable_visibility::project)); - const variable& cv (var_pool.insert (name + ".configured", - variable_visibility::project)); + auto& vp (var_pool.rw (rs)); + + const variable& lv (vp.insert (name + ".loaded", + variable_visibility::project)); + + const variable& cv (vp.insert (name + ".configured", + variable_visibility::project)); bs.assign (lv) = l; bs.assign (cv) = c; -- cgit v1.1