Index: runtime/vm/profiler_android.cc |
diff --git a/runtime/vm/profiler_android.cc b/runtime/vm/profiler_android.cc |
index 1392739ddc066e6141c6cdd312df4b24a7f8d1e5..5d9167cadae2d8bf42a07feb79b57394445e0737 100644 |
--- a/runtime/vm/profiler_android.cc |
+++ b/runtime/vm/profiler_android.cc |
@@ -28,13 +28,15 @@ static void ProfileSignalAction(int signal, siginfo_t* info, void* context_) { |
// Thread owns isolate profiler data mutex. |
ScopedMutex profiler_data_lock(isolate->profiler_data_mutex()); |
IsolateProfilerData* profiler_data = isolate->profiler_data(); |
- if (profiler_data == NULL) { |
- return; |
- } |
- if (!profiler_data->CanExpire()) { |
+ if ((profiler_data == NULL) || !profiler_data->CanExpire() || |
+ (profiler_data->sample_buffer() == NULL)) { |
// Descheduled. |
return; |
} |
+ if (profiler_data->thread_id() == Thread::GetCurrentThreadId()) { |
+ // Still scheduled on this thread. |
+ // TODO(johnmccutchan): Perform sample on Android. |
+ } |
} |
// Thread owns no profiler locks at this point. |
// This call will acquire both ProfilerManager::monitor and the |