From 3571754e0627bcd384c6a3d7b24476a3d74e02b9 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Thu, 16 Jul 2020 16:16:03 -0700 Subject: [PATCH] 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." --- src/env.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/env.cpp b/src/env.cpp index 8d9ad1a12..108ebf741 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -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;