report: add missing locks for report_on_fatalerror accessors

Overlooked in 2fa74e3e38.

Refs: https://github.com/nodejs/node/pull/32207

PR-URL: https://github.com/nodejs/node/pull/32535
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
Anna Henningsen
2020-03-28 14:42:51 +01:00
parent 2a885151e9
commit e06512b9b7

View File

@@ -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<Value>& info) {
}
static void ShouldReportOnFatalError(const FunctionCallbackInfo<Value>& 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<Value>& 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();
}