Skip to content

Commit

Permalink
src: lock-free init_process_flags
Browse files Browse the repository at this point in the history
Fix #45152

PR-URL: #45221
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
  • Loading branch information
kapouer authored and RafaelGSS committed Nov 10, 2022
1 parent 738144c commit 97547bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ void ResetSignalHandlers() {
#endif // __POSIX__
}

static std::atomic<uint64_t> init_process_flags = 0;
static std::atomic<uint32_t> init_process_flags = 0;

static void PlatformInit(ProcessInitializationFlags::Flags flags) {
// init_process_flags is accessed in ResetStdio(),
Expand Down
2 changes: 2 additions & 0 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ class MultiIsolatePlatform;
class InitializationResultImpl;

namespace ProcessFlags {
// TODO(addaleax): Switch to uint32_t to match std::atomic<uint32_t>
// init_process_flags in node.cc
enum Flags : uint64_t {
kNoFlags = 0,
// Enable stdio inheritance, which is disabled by default.
Expand Down

0 comments on commit 97547bc

Please sign in to comment.