diff options
Diffstat (limited to 'libbuild2/context.hxx')
-rw-r--r-- | libbuild2/context.hxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libbuild2/context.hxx b/libbuild2/context.hxx index c4d85c9..9df7a88 100644 --- a/libbuild2/context.hxx +++ b/libbuild2/context.hxx @@ -94,8 +94,18 @@ namespace build2 explicit global_mutexes (size_t vc) - : variable_cache_size (vc), - variable_cache (new shared_mutex[variable_cache_size]) {} + { + init (vc); + } + + global_mutexes () = default; // Create uninitialized instance. + + void + init (size_t vc) + { + variable_cache_size = vc; + variable_cache.reset (new shared_mutex[vc]); + } }; // A build context encapsulates the state of a build. It is possible to have |