aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-30 12:44:15 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:41 +0200
commit1f543f6eb368c3b23aa1f9cd2d23f0dba1456dec (patch)
treea3c1b756c2cc27fac0ac392ce8d108e147b23840 /build2/variable.cxx
parentb262d2c9c56eed18d043dccefac02b54a6ae2f95 (diff)
Add notion of load phase generation
Diffstat (limited to 'build2/variable.cxx')
-rw-r--r--build2/variable.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/build2/variable.cxx b/build2/variable.cxx
index 8695623..16fbe74 100644
--- a/build2/variable.cxx
+++ b/build2/variable.cxx
@@ -922,9 +922,12 @@ namespace build2
bool uv (v != nullptr && var.visibility != *v);
// In the global pool existing variables can only be updated during
- // serial load.
+ // the same load generation or during serial execution.
//
- assert (!global_ || !(ut || uv) || model_lock == nullptr);
+ assert (!global_ ||
+ !(ut || uv) ||
+ load_generation == 0 ||
+ var.generation == load_generation);
// Update type?
//
@@ -1012,7 +1015,8 @@ namespace build2
move (n),
t,
nullptr,
- v != nullptr ? *v : variable_visibility::normal}));
+ v != nullptr ? *v : variable_visibility::normal,
+ load_generation}));
variable& r (p.first->second);
@@ -1034,6 +1038,8 @@ namespace build2
bool o,
variable_visibility v)
{
+ assert (!global_ || phase == run_phase::load);
+
size_t pn (p.size ());
size_t w (p.find ('*'));