Index: runtime/vm/thread_interrupter_win.cc |
diff --git a/runtime/vm/thread_interrupter_win.cc b/runtime/vm/thread_interrupter_win.cc |
index 1bfd84f78bc501896064a641709e70d5fec0e0b6..d1b46cee54d7e63b879c68159ed2aefa50000478 100644 |
--- a/runtime/vm/thread_interrupter_win.cc |
+++ b/runtime/vm/thread_interrupter_win.cc |
@@ -51,57 +51,58 @@ class ThreadInterrupterWin : public AllStatic { |
} |
- static void Interrupt(InterruptableThreadState* state) { |
- ASSERT(!OSThread::Compare(GetCurrentThreadId(), state->id)); |
+ static void Interrupt(Thread* thread) { |
+ ASSERT(!OSThread::Compare(GetCurrentThreadId(), thread->id())); |
HANDLE handle = OpenThread(THREAD_GET_CONTEXT | |
THREAD_QUERY_INFORMATION | |
THREAD_SUSPEND_RESUME, |
false, |
- state->id); |
+ thread->id()); |
ASSERT(handle != NULL); |
DWORD result = SuspendThread(handle); |
if (result == kThreadError) { |
if (FLAG_trace_thread_interrupter) { |
OS::Print("ThreadInterrupted failed to suspend thread %p\n", |
koda
2015/08/20 15:45:14
ThreadInterrupted -> ThreadInterrupter
Cutch
2015/08/20 20:40:19
Done.
|
- reinterpret_cast<void*>(state->id)); |
+ reinterpret_cast<void*>(thread->id())); |
} |
CloseHandle(handle); |
return; |
} |
InterruptedThreadState its; |
- its.tid = state->id; |
+ its.tid = thread->id(); |
if (!GrabRegisters(handle, &its)) { |
// Failed to get thread registers. |
ResumeThread(handle); |
if (FLAG_trace_thread_interrupter) { |
OS::Print("ThreadInterrupted failed to get registers for %p\n", |
koda
2015/08/20 15:45:14
Ditto.
Cutch
2015/08/20 20:40:19
Done.
|
- reinterpret_cast<void*>(state->id)); |
+ reinterpret_cast<void*>(thread->id())); |
} |
CloseHandle(handle); |
return; |
} |
- if (state->callback == NULL) { |
+ ThreadInterruptCallback callback = thread->thread_interrupt_callback(); |
+ if (callback == NULL) { |
// No callback registered. |
ResumeThread(handle); |
CloseHandle(handle); |
return; |
} |
- state->callback(its, state->data); |
+ callback(its, state->thread_interrupt_data()); |
koda
2015/08/20 15:45:14
Compile error: state -> thread
Cutch
2015/08/20 20:40:19
Done.
|
ResumeThread(handle); |
CloseHandle(handle); |
} |
}; |
-void ThreadInterrupter::InterruptThread(InterruptableThreadState* state) { |
+void ThreadInterrupter::InterruptThread(Thread* thread) { |
if (FLAG_trace_thread_interrupter) { |
OS::Print("ThreadInterrupter suspending %p\n", |
- reinterpret_cast<void*>(state->id)); |
+ reinterpret_cast<void*>(thread->id())); |
} |
- ThreadInterrupterWin::Interrupt(state); |
+ ThreadInterrupterWin::Interrupt(thread); |
if (FLAG_trace_thread_interrupter) { |
OS::Print("ThreadInterrupter resuming %p\n", |
- reinterpret_cast<void*>(state->id)); |
+ reinterpret_cast<void*>(thread->id())); |
} |
} |