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
toutil.h
since it's only used inutil.cc
andnode.cc
- Rename
process_mutex
totty_mutex
and move it intonode_errors.cc
since that's the only place it's used to guard the tty. - Move
per_process_opts_mutex
andper_process_opts
intonode_options.h
and rename them toper_process::cli_options[_mutex]
- Rename
node_isolate[_mutex]
toper_process::main_isolate[_mutex]
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
commit message follows commit guidelines