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

Unified Diff: runtime/vm/thread_interrupter_macos.cc

Issue 128653004: Use list of isolates in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 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_interrupter_macos.cc
diff --git a/runtime/vm/thread_interrupter_macos.cc b/runtime/vm/thread_interrupter_macos.cc
index f9deca5690377c4ed729629275efdf9907452762..7e9ad5f3c5dad3bc49915680e03e44e2e48b5fd7 100644
--- a/runtime/vm/thread_interrupter_macos.cc
+++ b/runtime/vm/thread_interrupter_macos.cc
@@ -20,14 +20,12 @@ class ThreadInterrupterMacOS : public AllStatic {
if (signal != SIGPROF) {
return;
}
- ThreadInterrupter::ThreadState* state =
- ThreadInterrupter::CurrentThreadState();
+ InterruptableThreadState* state = ThreadInterrupter::CurrentThreadState();
if ((state == NULL) || (state->callback == NULL)) {
// No interrupter state or callback.
return;
}
ASSERT(Thread::Compare(state->id, Thread::GetCurrentThreadId()));
-
// Extract thread state.
ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
mcontext_t mcontext = context->uc_mcontext;
@@ -42,8 +40,13 @@ class ThreadInterrupterMacOS : public AllStatic {
void ThreadInterrupter::InterruptThreads(int64_t current_time) {
- for (intptr_t i = 0; i < threads_size_; i++) {
- ThreadState* state = threads_[i];
+ for (intptr_t i = 0; i < Isolate::isolates_size_; i++) {
+ Isolate* isolate = Isolate::isolates_[i];
+ ASSERT(isolate != NULL);
+ InterruptableThreadState* state = isolate->thread_state();
+ if (state == NULL) {
+ continue;
+ }
ASSERT(state->id != Thread::kInvalidThreadId);
if (FLAG_trace_thread_interrupter) {
OS::Print("ThreadInterrupter interrupting %p\n", state->id);

Powered by Google App Engine
This is Rietveld 408576698