From 4416546a602d28ea37b7dac69ab0903400dd9afd Mon Sep 17 00:00:00 2001 From: Jan Olaf Krems Date: Mon, 26 Jun 2023 22:08:47 +0000 Subject: [PATCH] src: initialize fields accessed by AsyncHooks before AsyncHooks PR-URL: https://github.com/nodejs/node/pull/48566 --- src/env.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/env.h b/src/env.h index dc9ba3baeb2b4b..d70d3b0f901e82 100644 --- a/src/env.h +++ b/src/env.h @@ -1015,6 +1015,9 @@ class Environment : public MemoryRetainer { uv_async_t task_queues_async_; int64_t task_queues_async_refs_ = 0; + std::atomic_bool is_stopping_{false}; + std::atomic_bool can_call_into_js_{true}; + AsyncHooks async_hooks_; ImmediateInfo immediate_info_; AliasedInt32Array timeout_info_; @@ -1092,7 +1095,6 @@ class Environment : public MemoryRetainer { bool has_serialized_options_ = false; - std::atomic_bool can_call_into_js_ { true }; uint64_t flags_; uint64_t thread_id_; std::unordered_set sub_worker_contexts_; @@ -1150,8 +1152,6 @@ class Environment : public MemoryRetainer { CleanupQueue cleanup_queue_; bool started_cleanup_ = false; - std::atomic_bool is_stopping_ { false }; - std::unordered_set unmanaged_fds_; std::function process_exit_handler_{