Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(141)

Side by Side Diff: runtime/vm/thread_interrupter_win.cc

Issue 1412733008: Switch profiler from isolates to threads (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // Failed to get thread registers. 74 // Failed to get thread registers.
75 ResumeThread(handle); 75 ResumeThread(handle);
76 if (FLAG_trace_thread_interrupter) { 76 if (FLAG_trace_thread_interrupter) {
77 OS::Print("ThreadInterrupter failed to get registers for %p\n", 77 OS::Print("ThreadInterrupter failed to get registers for %p\n",
78 reinterpret_cast<void*>(thread->id())); 78 reinterpret_cast<void*>(thread->id()));
79 } 79 }
80 CloseHandle(handle); 80 CloseHandle(handle);
81 return; 81 return;
82 } 82 }
83 ThreadInterruptCallback callback = NULL; 83 ThreadInterruptCallback callback = NULL;
84 void* callback_data = NULL; 84 if (thread->GetThreadInterruptCallback(&callback)) {
85 if (thread->IsThreadInterrupterEnabled(&callback, &callback_data)) { 85 callback(thread, its);
86 callback(its, callback_data);
87 } 86 }
88 ResumeThread(handle); 87 ResumeThread(handle);
89 CloseHandle(handle); 88 CloseHandle(handle);
90 } 89 }
91 }; 90 };
92 91
93 92
94 void ThreadInterrupter::InterruptThread(Thread* thread) { 93 void ThreadInterrupter::InterruptThread(Thread* thread) {
95 if (FLAG_trace_thread_interrupter) { 94 if (FLAG_trace_thread_interrupter) {
96 OS::Print("ThreadInterrupter suspending %p\n", 95 OS::Print("ThreadInterrupter suspending %p\n",
(...skipping 14 matching lines...) Expand all
111 110
112 void ThreadInterrupter::RemoveSignalHandler() { 111 void ThreadInterrupter::RemoveSignalHandler() {
113 // Nothing to do on Windows. 112 // Nothing to do on Windows.
114 } 113 }
115 114
116 115
117 } // namespace dart 116 } // namespace dart
118 117
119 #endif // defined(TARGET_OS_WINDOWS) 118 #endif // defined(TARGET_OS_WINDOWS)
120 119
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698