| Index: runtime/vm/thread_interrupter_linux.cc
|
| diff --git a/runtime/vm/thread_interrupter_linux.cc b/runtime/vm/thread_interrupter_linux.cc
|
| index 5b275c237bbd41509ecca03c72f9fd82f352ad0a..d7b9b8532abf2e3fd05d76603f5ff89e81dedf69 100644
|
| --- a/runtime/vm/thread_interrupter_linux.cc
|
| +++ b/runtime/vm/thread_interrupter_linux.cc
|
| @@ -22,33 +22,36 @@ class ThreadInterrupterLinux : public AllStatic {
|
| if (signal != SIGPROF) {
|
| return;
|
| }
|
| - InterruptableThreadState* state = ThreadInterrupter::CurrentThreadState();
|
| - if ((state == NULL) || (state->callback == NULL)) {
|
| - // No interrupter state or callback.
|
| + Thread* thread = Thread::Current();
|
| + if (thread == NULL) {
|
| + return;
|
| + }
|
| + ThreadInterruptCallback callback = NULL;
|
| + void* callback_data = NULL;
|
| + if (!thread->IsThreadInterrupterEnabled(&callback, &callback_data)) {
|
| return;
|
| }
|
| - ASSERT(OSThread::Compare(state->id, OSThread::GetCurrentThreadId()));
|
| // Extract thread state.
|
| ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
|
| mcontext_t mcontext = context->uc_mcontext;
|
| InterruptedThreadState its;
|
| - its.tid = state->id;
|
| + 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);
|
| - state->callback(its, state->data);
|
| + callback(its, callback_data);
|
| }
|
| };
|
|
|
|
|
| -void ThreadInterrupter::InterruptThread(InterruptableThreadState* state) {
|
| +void ThreadInterrupter::InterruptThread(Thread* thread) {
|
| if (FLAG_trace_thread_interrupter) {
|
| OS::Print("ThreadInterrupter interrupting %p\n",
|
| - reinterpret_cast<void*>(state->id));
|
| + reinterpret_cast<void*>(thread->id()));
|
| }
|
| - int result = pthread_kill(state->id, SIGPROF);
|
| + int result = pthread_kill(thread->id(), SIGPROF);
|
| ASSERT(result == 0);
|
| }
|
|
|
|
|