Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(659)

Unified Diff: runtime/vm/thread.cc

Issue 1408923005: Add IsMutatorThread to the Thread class and use it instead of MutatorThreadIsCurrentThread (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index a2af102a7ebc4736a645e2fd800e2c5b4ef5aa8a..076031063d2361f5a05639563ef7765df7cd4a74 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -341,7 +341,7 @@ void Thread::EnterIsolateAsHelper(Isolate* isolate, bool bypass_safepoint) {
ASSERT(thread->thread_interrupt_data_ == NULL);
// Do not update isolate->mutator_thread, but perform sanity check:
// this thread should not be both the main mutator and helper.
- ASSERT(!isolate->MutatorThreadIsCurrentThread());
+ ASSERT(!thread->IsMutatorThread());
thread->Schedule(isolate, bypass_safepoint);
}
@@ -355,7 +355,7 @@ void Thread::ExitIsolateAsHelper(bool bypass_safepoint) {
thread->StoreBufferRelease();
thread->isolate_ = NULL;
thread->heap_ = NULL;
- ASSERT(!isolate->MutatorThreadIsCurrentThread());
+ ASSERT(!thread->IsMutatorThread());
}
@@ -406,6 +406,11 @@ void Thread::StoreBufferAcquire() {
}
+bool Thread::IsMutatorThread() const {
+ return ((isolate_ != NULL) && (isolate_->mutator_thread() == this));
+}
+
+
CHA* Thread::cha() const {
ASSERT(isolate_ != NULL);
return cha_;
« runtime/vm/debugger.h ('K') | « runtime/vm/thread.h ('k') | runtime/vm/thread_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698