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: nodejs#32207
  • Loading branch information
addaleax committed Mar 28, 2020
1 parent cd1db2d commit 9336772
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/node_report_module.cc
Original file line number Diff line number Diff line change
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 @@ -129,12 +130,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 9336772

Please sign in to comment.