From 4b96fc522c1fdc2a8f0e61bdf16de1f430ad02d0 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sat, 28 Mar 2020 14:42:51 +0100 Subject: [PATCH] report: add missing locks for report_on_fatalerror accessors Overlooked in 2fa74e3e38bb028339e48763138456b3ed10ed97. Refs: https://github.com/nodejs/node/pull/32207 PR-URL: https://github.com/nodejs/node/pull/32535 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Gireesh Punathil --- src/node_report_module.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/node_report_module.cc b/src/node_report_module.cc index a0b54d5e6004f4..700dd88aba645e 100644 --- a/src/node_report_module.cc +++ b/src/node_report_module.cc @@ -16,6 +16,7 @@ namespace report { using node::Environment; +using node::Mutex; using node::Utf8Value; using v8::Boolean; using v8::Context; @@ -134,12 +135,14 @@ static void SetSignal(const FunctionCallbackInfo& info) { } static void ShouldReportOnFatalError(const FunctionCallbackInfo& info) { + Mutex::ScopedLock lock(node::per_process::cli_options_mutex); info.GetReturnValue().Set( node::per_process::cli_options->report_on_fatalerror); } static void SetReportOnFatalError(const FunctionCallbackInfo& info) { CHECK(info[0]->IsBoolean()); + Mutex::ScopedLock lock(node::per_process::cli_options_mutex); node::per_process::cli_options->report_on_fatalerror = info[0]->IsTrue(); }