Skip to content

Commit 9c0b1e0

Browse files
rmacnak-googleCommit Queue
authored and
Commit Queue
committed
[vm, profiler] Remove race between sample processor and stub code initialization.
TEST=tsan Bug: #54226 Change-Id: I54ce983acae28474c4a31200922b902dd19cf95d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/339643 Reviewed-by: Ben Konyi <[email protected]> Commit-Queue: Ryan Macnak <[email protected]>
1 parent ea57365 commit 9c0b1e0

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

runtime/vm/dart.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ char* Dart::DartInit(const Dart_InitializeParams* params) {
342342
ForwardingCorpse::Init();
343343
Api::Init();
344344
NativeSymbolResolver::Init();
345-
NOT_IN_PRODUCT(Profiler::Init());
346345
UnwindingRecordsPlatform::Init();
347346
Page::Init();
348347
StoreBuffer::Init();
@@ -486,6 +485,7 @@ char* Dart::DartInit(const Dart_InitializeParams* params) {
486485
vm_isolate_group()->heap()->Verify("Dart::DartInit", kRequireMarked);
487486
#endif
488487
}
488+
NOT_IN_PRODUCT(Profiler::Init());
489489
// Allocate the "persistent" scoped handles for the predefined API
490490
// values (such as Dart_True, Dart_False and Dart_Null).
491491
Api::InitHandles();

runtime/vm/profiler.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1895,6 +1895,8 @@ void SampleBlockProcessor::ThreadMain(uword parameters) {
18951895
}
18961896

18971897
IsolateGroup::ForEach([&](IsolateGroup* group) {
1898+
if (group == Dart::vm_isolate_group()) return;
1899+
18981900
const bool kBypassSafepoint = false;
18991901
Thread::EnterIsolateGroupAsHelper(group, Thread::kSampleBlockTask,
19001902
kBypassSafepoint);

0 commit comments

Comments
 (0)