Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! src: use uint32_t for process initialization flags enum
  • Loading branch information
addaleax committed Jan 31, 2023
commit c259b3b3aecfa43af4db190b78094690f2faeef4
3 changes: 3 additions & 0 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,9 @@ void ResetSignalHandlers() {
#endif // __POSIX__
}

// We use uint32_t since that can be accessed as a lock-free atomic
// variable on all platforms that we support, which we require in
// order for its value to be usable inside signal handlers.
static std::atomic<uint32_t> init_process_flags = 0;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a comment here describing why we use a uint32_t?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense – done in c259b3b!

static_assert(
std::is_same_v<std::underlying_type_t<ProcessInitializationFlags::Flags>,
Expand Down