[vm, mac] Disable TSAN during profiler sample collection.

The suspended thread might hold a TSAN-internal lock to a location that will be read by the sampling thread, which would cause a dead lock.

TEST=tsan
Bug: https://github.com/dart-lang/sdk/issues/62332
Change-Id: I0ac6a05c25067749b52ed83b14f80ab1850013a3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/471321
Commit-Queue: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
This commit is contained in:
Ryan Macnak
2026-01-07 12:47:21 -08:00
committed by Commit Queue
parent 61c3fbc220
commit 894a5fa7d5
7 changed files with 54 additions and 56 deletions
-10
View File
@@ -1056,20 +1056,10 @@ bool Thread::IsExecutingDartCode() const {
return (top_exit_frame_info() == 0) && VMTag::IsDartTag(vm_tag());
}
bool Thread::IsExecutingDartCodeIgnoreRace() const {
return (top_exit_frame_info_ignore_race() == 0) &&
VMTag::IsDartTag(vm_tag_ignore_race());
}
bool Thread::HasExitedDartCode() const {
return (top_exit_frame_info() != 0) && !VMTag::IsDartTag(vm_tag());
}
bool Thread::HasExitedDartCodeIgnoreRace() const {
return (top_exit_frame_info_ignore_race() != 0) &&
!VMTag::IsDartTag(vm_tag_ignore_race());
}
template <class C>
C* Thread::AllocateReusableHandle() {
C* handle = reinterpret_cast<C*>(reusable_handles_.AllocateScopedHandle());