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/cli/init.cxx | 4 ++-- build2/cli/rule | 4 ++-- build2/cli/rule.cxx | 16 ++++++++-------- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'build2/cli') diff --git a/build2/cli/init.cxx b/build2/cli/init.cxx index b34711d..2650c1b 100644 --- a/build2/cli/init.cxx +++ b/build2/cli/init.cxx @@ -43,7 +43,7 @@ namespace build2 // if (first) { - auto& v (var_pool); + auto& v (var_pool.rw (rs)); // Note: some overridable, some not. // @@ -274,7 +274,7 @@ namespace build2 // if (!cast_false (bs["cli.config.loaded"])) { - if (!load_module ("cli.config", rs, bs, l, optional, hints)) + if (!load_module (rs, bs, "cli.config", l, optional, hints)) return false; } else if (!cast_false (bs["cli.config.configured"])) diff --git a/build2/cli/rule b/build2/cli/rule index a46163b..fbacacf 100644 --- a/build2/cli/rule +++ b/build2/cli/rule @@ -20,10 +20,10 @@ namespace build2 compile () {} 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_update (action, target&); diff --git a/build2/cli/rule.cxx b/build2/cli/rule.cxx index 706830c..8cef1f5 100644 --- a/build2/cli/rule.cxx +++ b/build2/cli/rule.cxx @@ -44,7 +44,7 @@ namespace build2 } match_result compile:: - match (action a, target& xt, const string&) const + match (slock& ml, action a, target& xt, const string&) const { tracer trace ("cli::compile::match"); @@ -57,7 +57,7 @@ namespace build2 // See if we have a .cli source file. // bool r (false); - for (prerequisite_member p: group_prerequisite_members (a, t)) + for (prerequisite_member p: group_prerequisite_members (ml, a, t)) { if (p.is_a ()) { @@ -125,7 +125,7 @@ namespace build2 // if (g == nullptr || !g->has_prerequisites ()) { - for (prerequisite_member p: group_prerequisite_members (a, t)) + for (prerequisite_member p: group_prerequisite_members (ml, a, t)) { if (p.is_a ()) { @@ -151,7 +151,7 @@ namespace build2 // Resolve the group's members. This should link us up to the // group. // - resolve_group_members (a, *g); + resolve_group_members (ml, a, *g); // For ixx{}, verify it is part of the group. // @@ -169,7 +169,7 @@ namespace build2 } recipe compile:: - apply (action a, target& xt) const + apply (slock& ml, action a, target& xt) const { if (cli_cxx* pt = xt.is_a ()) { @@ -184,11 +184,11 @@ namespace build2 // Inject dependency on the output directory. // - inject_fsdir (a, t); + inject_fsdir (ml, a, t); // Search and match prerequisite members. // - search_and_match_prerequisite_members (a, t); + search_and_match_prerequisite_members (ml, a, t); switch (a) { @@ -200,7 +200,7 @@ namespace build2 else { cli_cxx& g (*static_cast (xt.group)); - build2::match (a, g); + build2::match (ml, a, g); return group_recipe; // Execute the group's recipe. } } -- cgit v1.1