From 3d1bdc954dadfd64117a251bfcde6f237c30fd68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Mon, 31 Oct 2022 21:45:00 +0100 Subject: [PATCH] src: lock-free init_process_flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix https://github.com/nodejs/node/issues/45152 PR-URL: https://github.com/nodejs/node/pull/45221 Reviewed-By: Anna Henningsen Reviewed-By: Juan José Arboleda Reviewed-By: Gerhard Stöbich --- src/node.cc | 2 +- src/node.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/node.cc b/src/node.cc index ae581a39b92552..dc28fb1d653f1c 100644 --- a/src/node.cc +++ b/src/node.cc @@ -429,7 +429,7 @@ void ResetSignalHandlers() { #endif // __POSIX__ } -static std::atomic init_process_flags = 0; +static std::atomic init_process_flags = 0; static void PlatformInit(ProcessInitializationFlags::Flags flags) { // init_process_flags is accessed in ResetStdio(), diff --git a/src/node.h b/src/node.h index 0e307ccb33361b..561af155561923 100644 --- a/src/node.h +++ b/src/node.h @@ -228,6 +228,8 @@ class MultiIsolatePlatform; class InitializationResultImpl; namespace ProcessFlags { +// TODO(addaleax): Switch to uint32_t to match std::atomic +// init_process_flags in node.cc enum Flags : uint64_t { kNoFlags = 0, // Enable stdio inheritance, which is disabled by default.