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/thread_interrupter.h" | 10 #include "vm/thread_interrupter.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 #else | 45 #else |
46 UNIMPLEMENTED(); | 46 UNIMPLEMENTED(); |
47 #endif | 47 #endif |
48 return true; | 48 return true; |
49 } | 49 } |
50 return false; | 50 return false; |
51 } | 51 } |
52 | 52 |
53 | 53 |
54 static void Interrupt(InterruptableThreadState* state) { | 54 static void Interrupt(InterruptableThreadState* state) { |
55 ASSERT(!Thread::Compare(GetCurrentThreadId(), state->id)); | 55 ASSERT(!OSThread::Compare(GetCurrentThreadId(), state->id)); |
56 HANDLE handle = OpenThread(THREAD_GET_CONTEXT | | 56 HANDLE handle = OpenThread(THREAD_GET_CONTEXT | |
57 THREAD_QUERY_INFORMATION | | 57 THREAD_QUERY_INFORMATION | |
58 THREAD_SUSPEND_RESUME, | 58 THREAD_SUSPEND_RESUME, |
59 false, | 59 false, |
60 state->id); | 60 state->id); |
61 ASSERT(handle != NULL); | 61 ASSERT(handle != NULL); |
62 DWORD result = SuspendThread(handle); | 62 DWORD result = SuspendThread(handle); |
63 if (result == kThreadError) { | 63 if (result == kThreadError) { |
64 if (FLAG_trace_thread_interrupter) { | 64 if (FLAG_trace_thread_interrupter) { |
65 OS::Print("ThreadInterrupted failed to suspend thread %p\n", | 65 OS::Print("ThreadInterrupted failed to suspend thread %p\n", |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 107 |
108 | 108 |
109 void ThreadInterrupter::InstallSignalHandler() { | 109 void ThreadInterrupter::InstallSignalHandler() { |
110 // Nothing to do on Windows. | 110 // Nothing to do on Windows. |
111 } | 111 } |
112 | 112 |
113 } // namespace dart | 113 } // namespace dart |
114 | 114 |
115 #endif // defined(TARGET_OS_WINDOWS) | 115 #endif // defined(TARGET_OS_WINDOWS) |
116 | 116 |
OLD | NEW |