Index: runtime/vm/isolate.cc |
diff --git a/runtime/vm/isolate.cc b/runtime/vm/isolate.cc |
index 077e7745dff9e9e04af947878e194e542b90d72f..7c57111528a813c32c21e977b2900cdaff875af7 100644 |
--- a/runtime/vm/isolate.cc |
+++ b/runtime/vm/isolate.cc |
@@ -1004,15 +1004,24 @@ void Isolate::PrintJSON(JSONStream* stream, bool ref) { |
} |
-void Isolate::ProfileInterrupt() { |
+bool Isolate::ProfileInterrupt() { |
+ if (profiler_data() == NULL) { |
+ // Profiler not setup for isolate. |
+ return false; |
+ } |
+ if (profiler_data()->blocked()) { |
+ // Profiler blocked for this isolate. |
+ return false; |
+ } |
InterruptableThreadState* state = thread_state(); |
if (state == NULL) { |
// Isolate is not scheduled on a thread. |
ProfileIdle(); |
- return; |
+ return true; |
} |
ASSERT(state->id != Thread::kInvalidThreadId); |
ThreadInterrupter::InterruptThread(state); |
+ return true; |
} |