From b47a323f09f1f9ccece03ca4d84dbe7a47ff8177 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 22 Oct 2019 10:02:23 +0200 Subject: Move global mutex shards to context --- libbuild2/variable.txx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libbuild2/variable.txx') 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 pair variable_cache:: - 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 () (this) % variable_cache_mutex_shard_size]); + ctx.mutex_shards.variable_cache[ + hash () (this) % ctx.mutex_shards.variable_cache_size]); slock sl (m); ulock ul (m, defer_lock); -- cgit v1.1