aboutsummaryrefslogtreecommitdiff
path: root/build2/b.cxx
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/b.cxx
parent38290dacd8faab166774d757a1e09807e57e9ba5 (diff)
Add MT-safe variable_cache, use for variable overrides
Diffstat (limited to 'build2/b.cxx')
-rw-r--r--build2/b.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/build2/b.cxx b/build2/b.cxx
index 14258b3..01d9378 100644
--- a/build2/b.cxx
+++ b/build2/b.cxx
@@ -273,7 +273,7 @@ main (int argc, char* argv[])
keep_going = !ops.serial_stop ();
- // Start up the scheduler.
+ // Start up the scheduler and allocate lock shards.
//
size_t jobs (0);
@@ -296,6 +296,10 @@ main (int argc, char* argv[])
sched.startup (jobs);
+ variable_cache_mutex_shard_size = sched.shard_size ();
+ variable_cache_mutex_shard.reset (
+ new shared_mutex[variable_cache_mutex_shard_size]);
+
// Trace some overall environment information.
//
if (verb >= 5)