From 9336772e34e16765017b94713766a67d81effbf3 Mon Sep 17 00:00:00 2001
From: Anna Henningsen <anna@addaleax.net>
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
---
 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 dfcae53be1313f..c208047d798459 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;
@@ -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();
 }