From 1f543f6eb368c3b23aa1f9cd2d23f0dba1456dec Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Jan 2017 12:44:15 +0200 Subject: Add notion of load phase generation --- build2/context.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'build2/context.cxx') diff --git a/build2/context.cxx b/build2/context.cxx index a8fe2df..a326002 100644 --- a/build2/context.cxx +++ b/build2/context.cxx @@ -25,7 +25,7 @@ namespace build2 { run_phase phase = run_phase::load; - shared_mutex model; + shared_mutex model_mutex; #ifdef __cpp_thread_local thread_local @@ -34,6 +34,8 @@ namespace build2 #endif slock* model_lock; + size_t load_generation; + const variable* var_src_root; const variable* var_out_root; const variable* var_src_base; @@ -188,7 +190,8 @@ namespace build2 // Add it if not found. // if (o->override == nullptr) - o->override.reset (new variable {n + k, nullptr, nullptr, v}); + const_cast (o)->override.reset ( + new variable {n + k, nullptr, nullptr, v, 0}); o = o->override.get (); -- cgit v1.1