summaryrefslogtreecommitdiff
path: root/src/node_credentials.cc
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2019-01-01 13:56:53 +0800
committerAnna Henningsen <anna@addaleax.net>2019-01-08 00:28:16 +0100
commit9db9e7e541c1ff9a30b7f1b61c6d3a7b6d30fab3 (patch)
treef16cfd671dd32467ae0cc221335118733c09030a /src/node_credentials.cc
parentae2d1f0e05449221ee770a393e5c967b359d9b1b (diff)
downloadandroid-node-v8-9db9e7e541c1ff9a30b7f1b61c6d3a7b6d30fab3.tar.gz
android-node-v8-9db9e7e541c1ff9a30b7f1b61c6d3a7b6d30fab3.tar.bz2
android-node-v8-9db9e7e541c1ff9a30b7f1b61c6d3a7b6d30fab3.zip
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]` PR-URL: https://github.com/nodejs/node/pull/25302 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/node_credentials.cc')
-rw-r--r--src/node_credentials.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_credentials.cc b/src/node_credentials.cc
index 82f6ef0dd8..1fea2659f7 100644
--- a/src/node_credentials.cc
+++ b/src/node_credentials.cc
@@ -38,7 +38,7 @@ bool SafeGetenv(const char* key, std::string* text) {
#endif
{
- Mutex::ScopedLock lock(environ_mutex);
+ Mutex::ScopedLock lock(per_process::env_var_mutex);
if (const char* value = getenv(key)) {
*text = value;
return true;