Skip to content

Commit f1b3c6e

Browse files
committed
src: initialize fields accessed by AsyncHooks before AsyncHooks
1 parent 32eb492 commit f1b3c6e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/env.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,9 @@ class Environment : public MemoryRetainer {
10151015
uv_async_t task_queues_async_;
10161016
int64_t task_queues_async_refs_ = 0;
10171017

1018+
std::atomic_bool is_stopping_ { false };
1019+
std::atomic_bool can_call_into_js_ { true };
1020+
10181021
AsyncHooks async_hooks_;
10191022
ImmediateInfo immediate_info_;
10201023
AliasedInt32Array timeout_info_;
@@ -1092,7 +1095,6 @@ class Environment : public MemoryRetainer {
10921095

10931096
bool has_serialized_options_ = false;
10941097

1095-
std::atomic_bool can_call_into_js_ { true };
10961098
uint64_t flags_;
10971099
uint64_t thread_id_;
10981100
std::unordered_set<worker::Worker*> sub_worker_contexts_;
@@ -1150,8 +1152,6 @@ class Environment : public MemoryRetainer {
11501152
CleanupQueue cleanup_queue_;
11511153
bool started_cleanup_ = false;
11521154

1153-
std::atomic_bool is_stopping_ { false };
1154-
11551155
std::unordered_set<int> unmanaged_fds_;
11561156

11571157
std::function<void(Environment*, ExitCode)> process_exit_handler_{

0 commit comments

Comments
 (0)