Skip to content

Commit c095520

Browse files
addaleaxtargos
authored andcommitted
report: add missing locks for report_on_fatalerror accessors
Overlooked in 2fa74e3. Refs: #32207 PR-URL: #32535 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent f284d59 commit c095520

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/node_report_module.cc

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
namespace report {
1818
using node::Environment;
19+
using node::Mutex;
1920
using node::Utf8Value;
2021
using v8::Boolean;
2122
using v8::Context;
@@ -134,12 +135,14 @@ static void SetSignal(const FunctionCallbackInfo<Value>& info) {
134135
}
135136

136137
static void ShouldReportOnFatalError(const FunctionCallbackInfo<Value>& info) {
138+
Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
137139
info.GetReturnValue().Set(
138140
node::per_process::cli_options->report_on_fatalerror);
139141
}
140142

141143
static void SetReportOnFatalError(const FunctionCallbackInfo<Value>& info) {
142144
CHECK(info[0]->IsBoolean());
145+
Mutex::ScopedLock lock(node::per_process::cli_options_mutex);
143146
node::per_process::cli_options->report_on_fatalerror = info[0]->IsTrue();
144147
}
145148

0 commit comments

Comments
 (0)