From 2fc42b0ecd3a07c9afa4ab1acc577a4d51d768e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Fri, 28 Oct 2022 11:32:02 +0200 Subject: [PATCH] src: lock-free init_process_flags Fix https://github.com/nodejs/node/issues/45152 --- src/node.cc | 2 +- src/node.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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..684bfd40f1a099 100644 --- a/src/node.h +++ b/src/node.h @@ -228,7 +228,8 @@ class MultiIsolatePlatform; class InitializationResultImpl; namespace ProcessFlags { -enum Flags : uint64_t { +// uint32_t is lock-free +enum Flags : uint32_t { kNoFlags = 0, // Enable stdio inheritance, which is disabled by default. // This flag is also implied by kNoStdioInitialization.