diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-22 14:32:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-10-22 14:32:49 +0200 |
commit | df69d473d3ab389e915698b8c2c4bb8d22975976 (patch) | |
tree | 3f624b109e8a91bb99aa649489f9a548ba088ddf /libbuild2/context.cxx | |
parent | 5483f5f54146ef6486db93a9a1c45b967d59c384 (diff) |
Implement loaded_modules state locking
This would be necessary if someone runs two parallel top-level contexts.
Diffstat (limited to 'libbuild2/context.cxx')
-rw-r--r-- | libbuild2/context.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libbuild2/context.cxx b/libbuild2/context.cxx index 841cc1d..292feed 100644 --- a/libbuild2/context.cxx +++ b/libbuild2/context.cxx @@ -60,7 +60,8 @@ namespace build2 bool dr, bool kg, const strings& cmd_vars, - optional<context*> mc) + optional<context*> mc, + const loaded_modules_lock* ml) : data_ (new data (*this)), sched (s), mutexes (ms), @@ -76,6 +77,7 @@ namespace build2 global_target_types (data_->global_target_types), global_override_cache (data_->global_override_cache), global_var_overrides (data_->global_var_overrides), + modules_lock (ml), module_context (mc ? *mc : nullptr), module_context_storage (mc ? optional<unique_ptr<context>> (nullptr) |