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()); |