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

Unified Diff: runtime/vm/thread.cc

Issue 1260283007: Fix race and limit access to mutator_thread_. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Remove debug print. Created 5 years, 4 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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread.cc
diff --git a/runtime/vm/thread.cc b/runtime/vm/thread.cc
index a79b086b7e5c0b587049a5e48c17b71d8c18d9ff..aa4f67ea92a647b00488f466a0e6f9ed26af02e4 100644
--- a/runtime/vm/thread.cc
+++ b/runtime/vm/thread.cc
@@ -123,9 +123,9 @@ void Thread::EnterIsolate(Isolate* isolate) {
Thread* thread = Thread::Current();
ASSERT(thread != NULL);
ASSERT(thread->isolate() == NULL);
- ASSERT(isolate->mutator_thread() == NULL);
+ ASSERT(!isolate->HasMutatorThread());
thread->isolate_ = isolate;
- isolate->set_mutator_thread(thread);
+ isolate->MakeCurrentThreadMutator(thread);
// TODO(koda): Migrate thread_state_ and profile_data_ to Thread, to allow
// helper threads concurrent with mutator.
ASSERT(isolate->thread_state() == NULL);
@@ -162,7 +162,7 @@ void Thread::ExitIsolate() {
}
isolate->set_thread_state(NULL);
Profiler::EndExecution(isolate);
- isolate->set_mutator_thread(NULL);
+ isolate->ClearMutatorThread();
thread->isolate_ = NULL;
ASSERT(Isolate::Current() == NULL);
thread->heap_ = NULL;
@@ -178,7 +178,7 @@ void Thread::EnterIsolateAsHelper(Isolate* isolate) {
thread->heap_ = isolate->heap();
// Do not update isolate->mutator_thread, but perform sanity check:
// this thread should not be both the main mutator and helper.
- ASSERT(isolate->mutator_thread() != thread);
+ ASSERT(!isolate->MutatorThreadIsCurrentThread());
thread->Schedule(isolate);
}
@@ -193,7 +193,7 @@ void Thread::ExitIsolateAsHelper() {
thread->Unschedule();
thread->isolate_ = NULL;
thread->heap_ = NULL;
- ASSERT(isolate->mutator_thread() != thread);
+ ASSERT(!isolate->MutatorThreadIsCurrentThread());
}
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/thread_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698