| Index: runtime/vm/thread_interrupter_android.cc
|
| diff --git a/runtime/vm/thread_interrupter_android.cc b/runtime/vm/thread_interrupter_android.cc
|
| index 5c4092dbe8c54ad6e69c34a53efdd6edcf70f917..552e5cde5c1f71bcbd8d7241511960d4c6e281cc 100644
|
| --- a/runtime/vm/thread_interrupter_android.cc
|
| +++ b/runtime/vm/thread_interrupter_android.cc
|
| @@ -6,6 +6,7 @@
|
| #if defined(TARGET_OS_ANDROID)
|
|
|
| #include <sys/syscall.h> // NOLINT
|
| +#include <errno.h> // NOLINT
|
|
|
| #include "vm/flags.h"
|
| #include "vm/os.h"
|
| @@ -29,21 +30,19 @@ class ThreadInterrupterAndroid : public AllStatic {
|
| return;
|
| }
|
| ThreadInterruptCallback callback = NULL;
|
| - void* callback_data = NULL;
|
| - if (!thread->IsThreadInterrupterEnabled(&callback, &callback_data)) {
|
| + if (!thread->GetThreadInterruptCallback(&callback)) {
|
| return;
|
| }
|
| // Extract thread state.
|
| ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
|
| mcontext_t mcontext = context->uc_mcontext;
|
| InterruptedThreadState its;
|
| - its.tid = thread->id();
|
| its.pc = SignalHandler::GetProgramCounter(mcontext);
|
| its.fp = SignalHandler::GetFramePointer(mcontext);
|
| its.csp = SignalHandler::GetCStackPointer(mcontext);
|
| its.dsp = SignalHandler::GetDartStackPointer(mcontext);
|
| its.lr = SignalHandler::GetLinkRegister(mcontext);
|
| - callback(its, callback_data);
|
| + callback(thread, its);
|
| }
|
| };
|
|
|
| @@ -54,7 +53,7 @@ void ThreadInterrupter::InterruptThread(Thread* thread) {
|
| reinterpret_cast<void*>(thread->id()));
|
| }
|
| int result = syscall(__NR_tgkill, getpid(), thread->id(), SIGPROF);
|
| - ASSERT(result == 0);
|
| + ASSERT((result == 0) || (result == ESRCH));
|
| }
|
|
|
|
|
|
|