Skip to content

Commit 348499d

Browse files
aamcommit-bot@chromium.org
authored andcommitted
[vm/concurrency] Remove ASSERT from IsMutatorThread to address r/w race isolate_ in vm thread.
Running tsan build locally on IsolateJson identified concurrent access to isolate_ from NoActiveIsolateScope/CollectNewSpaceGarbage and IsMutatorThread/SafepointThreads/Scavenge. Change-Id: I4c6f5c83a7f6ddbfee8ede59443720db62a48b6f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151023 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Alexander Aprelev <[email protected]>
1 parent c54ec8d commit 348499d

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

runtime/vm/thread.cc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -631,13 +631,6 @@ void Thread::DeferredMarkingStackAcquire() {
631631
isolate_group()->deferred_marking_stack()->PopEmptyBlock();
632632
}
633633

634-
bool Thread::IsMutatorThread() const {
635-
if (isolate_ != nullptr) {
636-
ASSERT(is_mutator_thread_ == (isolate_->mutator_thread() == this));
637-
}
638-
return is_mutator_thread_;
639-
}
640-
641634
bool Thread::CanCollectGarbage() const {
642635
// We grow the heap instead of triggering a garbage collection when a
643636
// thread is at a safepoint in the following situations :

runtime/vm/thread.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,8 @@ class Thread : public ThreadState {
401401
return OFFSET_OF(Thread, field_table_values_);
402402
}
403403

404-
bool IsMutatorThread() const;
404+
bool IsMutatorThread() const { return is_mutator_thread_; }
405+
405406
bool CanCollectGarbage() const;
406407

407408
// Offset of Dart TimelineStream object.

0 commit comments

Comments
 (0)