Skip to content

Commit

Permalink
report: add missing locks for report_on_fatalerror accessors
Browse files Browse the repository at this point in the history
Overlooked in 2fa74e3.

Refs: #32207

PR-URL: #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>
  • Loading branch information
addaleax authored and targos committed Apr 28, 2020
1 parent 73c55d3 commit 4b96fc5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/node_report_module.cc
Expand Up @@ -16,6 +16,7 @@

namespace report {
using node::Environment;
using node::Mutex;
using node::Utf8Value;
using v8::Boolean;
using v8::Context;
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit 4b96fc5

Please sign in to comment.