aboutsummaryrefslogtreecommitdiff
path: root/build2/bin
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-25 15:41:44 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:39:24 +0200
commit88f0780e34116c0441a8d8c58b8a8fd9fde4b1f5 (patch)
tree1240b36211772479dc1220712e0daed4e35ecd85 /build2/bin
parent61aa8e2b4bd7849838c04dc1f421c4760d88319f (diff)
Add model mutex, make var_pool const by default
Diffstat (limited to 'build2/bin')
-rw-r--r--build2/bin/init.cxx34
-rw-r--r--build2/bin/rule8
-rw-r--r--build2/bin/rule.cxx16
3 files changed, 29 insertions, 29 deletions
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<bool> (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<bool> (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<process_path> ("bin.rc.path");
v.insert<process_path> ("bin.ranlib.path");
@@ -528,7 +528,7 @@ namespace build2
if (ranlib != nullptr)
{
r.assign<process_path> ("bin.ranlib.path") = move (ari.ranlib_path);
- r.assign<string> ("bin.ranlib.id") = move (ari.ranlib_id);
+ r.assign<string> ("bin.ranlib.id") = move (ari.ranlib_id);
r.assign<string> ("bin.ranlib.signature") =
move (ari.ranlib_signature);
r.assign<string> ("bin.ranlib.checksum") =
@@ -554,10 +554,10 @@ namespace build2
// Make sure the bin core and ar.config are loaded.
//
if (!cast_false<bool> (b["bin.loaded"]))
- load_module ("bin", r, b, loc, false, hints);
+ load_module (r, b, "bin", loc, false, hints);
if (!cast_false<bool> (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<bool> (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<process_path> ("bin.ld.path");
v.insert<path> ("config.bin.ld", true);
@@ -652,10 +652,10 @@ namespace build2
// Make sure the bin core and ld.config are loaded.
//
if (!cast_false<bool> (b["bin.loaded"]))
- load_module ("bin", r, b, loc, false, hints);
+ load_module (r, b, "bin", loc, false, hints);
if (!cast_false<bool> (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<string> (r["bin.ld.id"]));
@@ -666,8 +666,8 @@ namespace build2
if (lid == "msvc")
{
const target_type& pdb (b.derive_target_type<file> ("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<bool> (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<process_path> ("bin.rc.path");
v.insert<path> ("config.bin.rc", true);
@@ -763,10 +763,10 @@ namespace build2
// Make sure the bin core and rc.config are loaded.
//
if (!cast_false<bool> (b["bin.loaded"]))
- load_module ("bin", r, b, loc, false, hints);
+ load_module (r, b, "bin", loc, false, hints);
if (!cast_false<bool> (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<lib&> (xt));
@@ -77,7 +77,7 @@ namespace build2
if (t.a == nullptr)
t.a = &search<liba> (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<libs> (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<lib&> (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;
}