Skip to content

Commit 825e0d2

Browse files
committed
[Squash] use atomic_uint64_t
1 parent 9ca9452 commit 825e0d2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/bootstrapper.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#include "node_internals.h"
44
#include "v8.h"
55

6+
#include <atomic>
7+
68
namespace node {
79

810
using v8::Array;
@@ -51,8 +53,8 @@ void SetupNextTick(const FunctionCallbackInfo<Value>& args) {
5153
}
5254

5355
void PromiseRejectCallback(PromiseRejectMessage message) {
54-
static uint64_t unhandledRejections = 0;
55-
static uint64_t rejectionsHandledAfter = 0;
56+
static std::atomic_uint64_t unhandledRejections{0};
57+
static std::atomic_uint64_t rejectionsHandledAfter{0};
5658

5759
Local<Promise> promise = message.GetPromise();
5860
Isolate* isolate = promise->GetIsolate();

0 commit comments

Comments
 (0)