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

Unified Diff: runtime/vm/isolate.cc

Issue 1293253005: Completely remove InterruptableThreadState and Fix ThreadRegistry leak (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
Index: runtime/vm/isolate.cc
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc
index 1327ef24db29e36369f887c28b2f51cbaff245db..46cdc585ec7a606771d92b575415639ae3a16896 100644
--- a/runtime/vm/isolate.cc
+++ b/runtime/vm/isolate.cc
@@ -1766,14 +1766,21 @@ intptr_t Isolate::ProfileInterrupt() {
// Paused at start / exit . Don't tick.
return 0;
}
- InterruptableThreadState* state = thread_state();
- if (state == NULL) {
- // Isolate is not scheduled on a thread.
+ if (mutator_thread_ == NULL) {
+ // No active mutator.
ProfileIdle();
return 1;
}
- ASSERT(state->id != OSThread::kInvalidThreadId);
- ThreadInterrupter::InterruptThread(state);
+
+ // TODO(johnmccutchan): Sample all threads, not just the mutator thread.
Ivan Posva 2015/08/20 18:00:10 Please make a note that sampling should be happeni
Cutch 2015/08/20 20:40:18 Done.
+ ThreadRegistry::EntryIterator it(thread_registry());
+ while (it.HasNext()) {
+ const ThreadRegistry::Entry& entry = it.Next();
+ if (entry.thread == mutator_thread_) {
+ ThreadInterrupter::InterruptThread(mutator_thread_);
+ break;
+ }
+ }
return 1;
}
@@ -1926,19 +1933,6 @@ void Isolate::RemoveIsolateFromList(Isolate* isolate) {
}
-#if defined(DEBUG)
-void Isolate::CheckForDuplicateThreadState(InterruptableThreadState* state) {
- MonitorLocker ml(isolates_list_monitor_);
- ASSERT(state != NULL);
- Isolate* current = isolates_list_head_;
- while (current) {
- ASSERT(current->thread_state() != state);
- current = current->next_;
- }
-}
-#endif
-
-
template<class T>
T* Isolate::AllocateReusableHandle() {
T* handle = reinterpret_cast<T*>(reusable_handles_.AllocateScopedHandle());
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/profiler.cc » ('j') | runtime/vm/profiler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698