aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.txx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-10-22 10:02:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-10-22 10:17:41 +0200
commitb47a323f09f1f9ccece03ca4d84dbe7a47ff8177 (patch)
tree7c520e5878b1988425520424c5e372f7439636d9 /libbuild2/variable.txx
parent1bbd6bdb1bbf6783aefd10392e5c0599318a927f (diff)
Move global mutex shards to context
Diffstat (limited to 'libbuild2/variable.txx')
-rw-r--r--libbuild2/variable.txx10
1 files changed, 7 insertions, 3 deletions
diff --git a/libbuild2/variable.txx b/libbuild2/variable.txx
index 92b7169..ed25cb6 100644
--- a/libbuild2/variable.txx
+++ b/libbuild2/variable.txx
@@ -600,7 +600,11 @@ namespace build2
//
template <typename K>
pair<value&, ulock> variable_cache<K>::
- insert (K k, const lookup& stem, size_t ver, const variable& var)
+ insert (context& ctx,
+ K k,
+ const lookup& stem,
+ size_t ver,
+ const variable& var)
{
using value_data = variable_map::value_data;
@@ -610,8 +614,8 @@ namespace build2
: 0);
shared_mutex& m (
- variable_cache_mutex_shard[
- hash<variable_cache*> () (this) % variable_cache_mutex_shard_size]);
+ ctx.mutex_shards.variable_cache[
+ hash<variable_cache*> () (this) % ctx.mutex_shards.variable_cache_size]);
slock sl (m);
ulock ul (m, defer_lock);