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/bin/init.cxx | 34 +++++++++++++++++----------------- build2/bin/rule | 8 ++++---- build2/bin/rule.cxx | 16 ++++++++-------- 3 files changed, 29 insertions(+), 29 deletions(-) (limited to 'build2/bin') diff --git a/build2/bin/init.cxx b/build2/bin/init.cxx index 913c887..6bd2636 100644 --- a/build2/bin/init.cxx +++ b/build2/bin/init.cxx @@ -49,7 +49,7 @@ namespace build2 // if (first) { - auto& v (var_pool); + auto& v (var_pool.rw (r)); // Note: some overridable, some not. // @@ -325,7 +325,7 @@ namespace build2 // Load bin.config. // if (!cast_false (b["bin.config.loaded"])) - load_module ("bin.config", r, b, loc, false, hints); + load_module (r, b, "bin.config", loc, false, hints); // Cache some config values we will be needing below. // @@ -427,13 +427,13 @@ namespace build2 // Make sure bin.config is loaded. // if (!cast_false (b["bin.config.loaded"])) - load_module ("bin.config", r, b, loc, false, hints); + load_module (r, b, "bin.config", loc, false, hints); // Enter configuration variables. // if (first) { - auto& v (var_pool); + auto& v (var_pool.rw (r)); v.insert ("bin.rc.path"); v.insert ("bin.ranlib.path"); @@ -528,7 +528,7 @@ namespace build2 if (ranlib != nullptr) { r.assign ("bin.ranlib.path") = move (ari.ranlib_path); - r.assign ("bin.ranlib.id") = move (ari.ranlib_id); + r.assign ("bin.ranlib.id") = move (ari.ranlib_id); r.assign ("bin.ranlib.signature") = move (ari.ranlib_signature); r.assign ("bin.ranlib.checksum") = @@ -554,10 +554,10 @@ namespace build2 // Make sure the bin core and ar.config are loaded. // if (!cast_false (b["bin.loaded"])) - load_module ("bin", r, b, loc, false, hints); + load_module (r, b, "bin", loc, false, hints); if (!cast_false (b["bin.ar.config.loaded"])) - load_module ("bin.ar.config", r, b, loc, false, hints); + load_module (r, b, "bin.ar.config", loc, false, hints); return true; } @@ -577,13 +577,13 @@ namespace build2 // Make sure bin.config is loaded. // if (!cast_false (b["bin.config.loaded"])) - load_module ("bin.config", r, b, loc, false, hints); + load_module (r, b, "bin.config", loc, false, hints); // Enter configuration variables. // if (first) { - auto& v (var_pool); + auto& v (var_pool.rw (r)); v.insert ("bin.ld.path"); v.insert ("config.bin.ld", true); @@ -652,10 +652,10 @@ namespace build2 // Make sure the bin core and ld.config are loaded. // if (!cast_false (b["bin.loaded"])) - load_module ("bin", r, b, loc, false, hints); + load_module (r, b, "bin", loc, false, hints); if (!cast_false (b["bin.ld.config.loaded"])) - load_module ("bin.ld.config", r, b, loc, false, hints); + load_module (r, b, "bin.ld.config", loc, false, hints); const string& lid (cast (r["bin.ld.id"])); @@ -666,8 +666,8 @@ namespace build2 if (lid == "msvc") { const target_type& pdb (b.derive_target_type ("pdb").first); - install_path (pdb, b, dir_path ("bin")); // Goes to install.bin - install_mode (pdb, b, "644"); // But not executable. + install_path (b, pdb, dir_path ("bin")); // Goes to install.bin + install_mode (b, pdb, "644"); // But not executable. } return true; @@ -688,13 +688,13 @@ namespace build2 // Make sure bin.config is loaded. // if (!cast_false (b["bin.config.loaded"])) - load_module ("bin.config", r, b, loc, false, hints); + load_module (r, b, "bin.config", loc, false, hints); // Enter configuration variables. // if (first) { - auto& v (var_pool); + auto& v (var_pool.rw (r)); v.insert ("bin.rc.path"); v.insert ("config.bin.rc", true); @@ -763,10 +763,10 @@ namespace build2 // Make sure the bin core and rc.config are loaded. // if (!cast_false (b["bin.loaded"])) - load_module ("bin", r, b, loc, false, hints); + load_module (r, b, "bin", loc, false, hints); if (!cast_false (b["bin.rc.config.loaded"])) - load_module ("bin.rc.config", r, b, loc, false, hints); + load_module (r, b, "bin.rc.config", loc, false, hints); return true; } diff --git a/build2/bin/rule b/build2/bin/rule index 5031be1..c903990 100644 --- a/build2/bin/rule +++ b/build2/bin/rule @@ -20,10 +20,10 @@ namespace build2 obj_rule () {} virtual match_result - match (action, target&, const string& hint) const override; + match (slock&, action, target&, const string& hint) const override; virtual recipe - apply (action, target&) const override; + apply (slock&, action, target&) const override; }; class lib_rule: public rule @@ -32,10 +32,10 @@ namespace build2 lib_rule () {} virtual match_result - match (action, target&, const string& hint) const override; + match (slock&, action, target&, const string& hint) const override; virtual recipe - apply (action, target&) const override; + apply (slock&, action, target&) const override; static target_state perform (action, target&); diff --git a/build2/bin/rule.cxx b/build2/bin/rule.cxx index ede2c85..648c8b6 100644 --- a/build2/bin/rule.cxx +++ b/build2/bin/rule.cxx @@ -20,7 +20,7 @@ namespace build2 // obj // match_result obj_rule:: - match (action a, target& t, const string&) const + match (slock&, action a, target& t, const string&) const { fail << diag_doing (a, t) << " target group" << info << "explicitly select obje{}, obja{}, or objs{} member"; @@ -29,7 +29,7 @@ namespace build2 } recipe obj_rule:: - apply (action, target&) const {return empty_recipe;} + apply (slock&, action, target&) const {return empty_recipe;} // lib // @@ -46,7 +46,7 @@ namespace build2 "insufficient space"); match_result lib_rule:: - match (action act, target& xt, const string&) const + match (slock& ml, action act, target& xt, const string&) const { lib& t (static_cast (xt)); @@ -77,7 +77,7 @@ namespace build2 if (t.a == nullptr) t.a = &search (t.dir, t.out, t.name, nullopt, nullptr); - match_only (act, *t.a); + match_only (ml, act, *t.a); } if (s) @@ -85,7 +85,7 @@ namespace build2 if (t.s == nullptr) t.s = &search (t.dir, t.out, t.name, nullopt, nullptr); - match_only (act, *t.s); + match_only (ml, act, *t.s); } t.data (match_data {type}); // Save in the target's auxilary storage. @@ -102,7 +102,7 @@ namespace build2 } recipe lib_rule:: - apply (action act, target& xt) const + apply (slock& ml, action act, target& xt) const { lib& t (static_cast (xt)); @@ -115,10 +115,10 @@ namespace build2 // Now we do full match. // if (a) - build2::match (act, *t.a); + build2::match (ml, act, *t.a); if (s) - build2::match (act, *t.s); + build2::match (ml, act, *t.s); return &perform; } -- cgit v1.1