Only perform universal barriers for the principal env stack

In practice this means that, if fish ever gets multiple variable stacks,
we will only incorporate environment variable changes from other fish
instances on the "main thread."
This commit is contained in:
ridiculousfish 2020-07-16 16:16:03 -07:00
parent 0f78700f6b
commit 3571754e06

View File

@ -1208,6 +1208,11 @@ mod_result_t env_stack_impl_t::remove(const wcstring &key, int mode) {
}
bool env_stack_t::universal_barrier() {
// Only perform universal barriers for the principal env stack.
// This means that changes from other fish processes will only be visible when the "main thread
// runs."
if (!is_principal()) return false;
ASSERT_IS_MAIN_THREAD();
if (!uvars()) return false;