Skip to content

Commit f70dddb

Browse files
committed
Fix signal fencing
1 parent d1eb39b commit f70dddb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bindings/profilers/wall.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,21 +1163,21 @@ void WallProfiler::OnGCStart(v8::Isolate* isolate) {
11631163
gcContext = GetContextPtrSignalSafe(isolate);
11641164
}
11651165
}
1166-
gcCount.store(curCount + 1, std::memory_order_relaxed);
11671166
std::atomic_signal_fence(std::memory_order_release);
1167+
gcCount.store(curCount + 1, std::memory_order_relaxed);
11681168
}
11691169

11701170
void WallProfiler::OnGCEnd() {
11711171
auto newCount = gcCount.load(std::memory_order_relaxed) - 1;
11721172
std::atomic_signal_fence(std::memory_order_acquire);
11731173
gcCount.store(newCount, std::memory_order_relaxed);
1174+
std::atomic_signal_fence(std::memory_order_release);
11741175
if (newCount == 0) {
11751176
gcAsyncId = -1;
11761177
if (useCPED_) {
11771178
gcContext.reset();
11781179
}
11791180
}
1180-
std::atomic_signal_fence(std::memory_order_release);
11811181
}
11821182

11831183
void WallProfiler::PushContext(int64_t time_from,

0 commit comments

Comments
 (0)