Skip to content

src: move per-process global variables into node::per_process

So that it's easier to tell whether we are manipulating per-process global states that may need to be treated with care to avoid races.

Also added comments about these variables and moved some of them to a more suitable compilation unit:

  • Move v8_initialized to util.h since it's only used in util.cc and node.cc
  • Rename process_mutex to tty_mutex and move it into node_errors.cc since that's the only place it's used to guard the tty.
  • Move per_process_opts_mutex and per_process_opts into node_options.h and rename them to per_process::cli_options[_mutex]
  • Rename node_isolate[_mutex] to per_process::main_isolate[_mutex]
Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Merge request reports

Loading