| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 #include "vm/profiler.h" | 10 #include "vm/profiler.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #error Unsupported architecture. | 49 #error Unsupported architecture. |
| 50 #endif | 50 #endif |
| 51 return true; | 51 return true; |
| 52 } | 52 } |
| 53 return false; | 53 return false; |
| 54 } | 54 } |
| 55 | 55 |
| 56 | 56 |
| 57 static void Interrupt(OSThread* os_thread) { | 57 static void Interrupt(OSThread* os_thread) { |
| 58 ASSERT(!OSThread::Compare(GetCurrentThreadId(), os_thread->id())); | 58 ASSERT(!OSThread::Compare(GetCurrentThreadId(), os_thread->id())); |
| 59 HANDLE handle = OpenThread(THREAD_GET_CONTEXT | | 59 HANDLE handle = OpenThread( |
| 60 THREAD_QUERY_INFORMATION | | 60 THREAD_GET_CONTEXT | THREAD_QUERY_INFORMATION | THREAD_SUSPEND_RESUME, |
| 61 THREAD_SUSPEND_RESUME, | 61 false, os_thread->id()); |
| 62 false, | |
| 63 os_thread->id()); | |
| 64 ASSERT(handle != NULL); | 62 ASSERT(handle != NULL); |
| 65 DWORD result = SuspendThread(handle); | 63 DWORD result = SuspendThread(handle); |
| 66 if (result == kThreadError) { | 64 if (result == kThreadError) { |
| 67 if (FLAG_trace_thread_interrupter) { | 65 if (FLAG_trace_thread_interrupter) { |
| 68 OS::Print("ThreadInterrupter failed to suspend thread %p\n", | 66 OS::Print("ThreadInterrupter failed to suspend thread %p\n", |
| 69 reinterpret_cast<void*>(os_thread->id())); | 67 reinterpret_cast<void*>(os_thread->id())); |
| 70 } | 68 } |
| 71 CloseHandle(handle); | 69 CloseHandle(handle); |
| 72 return; | 70 return; |
| 73 } | 71 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 113 |
| 116 void ThreadInterrupter::RemoveSignalHandler() { | 114 void ThreadInterrupter::RemoveSignalHandler() { |
| 117 // Nothing to do on Windows. | 115 // Nothing to do on Windows. |
| 118 } | 116 } |
| 119 | 117 |
| 120 #endif // !PRODUCT | 118 #endif // !PRODUCT |
| 121 | 119 |
| 122 } // namespace dart | 120 } // namespace dart |
| 123 | 121 |
| 124 #endif // defined(TARGET_OS_WINDOWS) | 122 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |