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 <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: Gerhard Stöbich <[email protected]>
  • Loading branch information
kapouer authored and danielleadams committed Dec 30, 2022
1 parent 8dd43d9 commit 8247d10
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 @@ -445,7 +445,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 8247d10

Please sign in to comment.