aboutsummaryrefslogtreecommitdiff
path: root/build2/scope
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-02-13 09:48:12 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-02-13 12:42:42 +0200
commit737877e62467b924eea0a43eab68258b0c13db78 (patch)
tree3fe2f539a21ce0407cdaa908a9af56b4cf8087e0 /build2/scope
parent38290dacd8faab166774d757a1e09807e57e9ba5 (diff)
Add MT-safe variable_cache, use for variable overrides
Diffstat (limited to 'build2/scope')
-rw-r--r--build2/scope12
1 files changed, 12 insertions, 0 deletions
diff --git a/build2/scope b/build2/scope
index 64aaf24..2b86200 100644
--- a/build2/scope
+++ b/build2/scope
@@ -177,6 +177,18 @@ namespace build2
//
variable_type_map target_vars;
+ // Variable override cache (project root and global scope only).
+ //
+ // The key is the variable plus the innermost (scope-wise) variable map to
+ // which this override applies. See find_override() for details.
+ //
+ // Note: since it can be modified on any lookup (including during the
+ // execute phase), the cache is protected by its own mutex shard.
+ //
+ mutable
+ variable_cache<pair<const variable*, const variable_map*>>
+ override_cache;
+
// Meta/operations supported by this project (set on the root
// scope only).
//