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

Unified Diff: runtime/vm/isolate.h

Issue 2191723002: Fix race condition with HasMutatorThread that was being used without a lock. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address self review comments. Created 4 years, 5 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/dart_api_impl.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate.h
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index b49d59b130bf265f9f316dee4d2d03b39ab94e08..97610713f0d037987f19e5a04d65992df197fc57 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -177,15 +177,7 @@ class Isolate : public BaseIsolate {
message_notify_callback_ = value;
}
- // Limited public access to BaseIsolate::mutator_thread_ for code that
- // must treat the mutator as the default or a special case. Prefer code
- // that works uniformly across all threads.
- bool HasMutatorThread() {
- return mutator_thread_ != NULL;
- }
- Thread* mutator_thread() const {
- return mutator_thread_;
Florian Schneider 2016/07/28 18:13:36 Can you remove mutator_thread_ in BaseIsolate? It
siva 2016/07/28 20:15:10 The field is still used in EnterIsolate to ensure
- }
+ Thread* mutator_thread() const;
const char* name() const { return name_; }
const char* debugger_name() const { return debugger_name_; }
@@ -466,8 +458,7 @@ class Isolate : public BaseIsolate {
// Mutator thread is used to aggregate compiler stats.
CompilerStats* aggregate_compiler_stats() {
- ASSERT(HasMutatorThread());
- return mutator_thread_->compiler_stats();
+ return mutator_thread()->compiler_stats();
}
VMTagCounters* vm_tag_counters() {
@@ -693,8 +684,8 @@ class Isolate : public BaseIsolate {
// DEPRECATED: Use Thread's methods instead. During migration, these default
// to using the mutator thread (which must also be the current thread).
Zone* current_zone() const {
- ASSERT(Thread::Current() == mutator_thread_);
- return mutator_thread_->zone();
+ ASSERT(Thread::Current() == mutator_thread());
+ return mutator_thread()->zone();
}
// Accessed from generated code:
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/isolate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698