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

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

Issue 128653004: Use list of isolates in profiler (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months 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 | Annotate | Revision Log
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/thread_interrupter.h" 8 #include "vm/thread_interrupter.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 20 matching lines...) Expand all
31 state->sp = reinterpret_cast<uintptr_t>(context.Rsp); 31 state->sp = reinterpret_cast<uintptr_t>(context.Rsp);
32 #else 32 #else
33 UNIMPLEMENTED(); 33 UNIMPLEMENTED();
34 #endif 34 #endif
35 return true; 35 return true;
36 } 36 }
37 return false; 37 return false;
38 } 38 }
39 39
40 40
41 static void Interrupt(ThreadInterrupter::ThreadState* state) { 41 static void Interrupt(InterruptedThreadState* state) {
42 ASSERT(GetCurrentThread() != state->id); 42 ASSERT(GetCurrentThread() != state->id);
43 DWORD result = SuspendThread(state->id); 43 DWORD result = SuspendThread(state->id);
44 if (result == kThreadError) { 44 if (result == kThreadError) {
45 if (FLAG_trace_thread_interrupter) { 45 if (FLAG_trace_thread_interrupter) {
46 OS::Print("ThreadInterrupted failed to suspend thread %p\n", 46 OS::Print("ThreadInterrupted failed to suspend thread %p\n",
47 reinterpret_cast<void*>(state->id)); 47 reinterpret_cast<void*>(state->id));
48 } 48 }
49 return; 49 return;
50 } 50 }
51 InterruptedThreadState its; 51 InterruptedThreadState its;
(...skipping 12 matching lines...) Expand all
64 ResumeThread(state->id); 64 ResumeThread(state->id);
65 return; 65 return;
66 } 66 }
67 state->callback(its, state->data); 67 state->callback(its, state->data);
68 ResumeThread(state->id); 68 ResumeThread(state->id);
69 } 69 }
70 }; 70 };
71 71
72 72
73 void ThreadInterrupter::InterruptThreads(int64_t current_time) { 73 void ThreadInterrupter::InterruptThreads(int64_t current_time) {
74 for (intptr_t i = 0; i < threads_size_; i++) { 74 for (intptr_t i = 0; i < Isolate::isolates_size_; i++) {
75 ThreadState* state = threads_[i]; 75 Isolate* isolate = Isolate::isolates_[i];
76 ASSERT(isolate != NULL);
77 InterruptedThreadState* state = isolate->thread_state();
78 if (state == NULL) {
79 continue;
80 }
76 ASSERT(state->id != Thread::kInvalidThreadId); 81 ASSERT(state->id != Thread::kInvalidThreadId);
77 if (FLAG_trace_thread_interrupter) { 82 if (FLAG_trace_thread_interrupter) {
78 OS::Print("ThreadInterrupter suspending %p\n", 83 OS::Print("ThreadInterrupter suspending %p\n",
79 reinterpret_cast<void*>(state->id)); 84 reinterpret_cast<void*>(state->id));
80 } 85 }
81 ThreadInterrupterWin::Interrupt(state); 86 ThreadInterrupterWin::Interrupt(state);
82 if (FLAG_trace_thread_interrupter) { 87 if (FLAG_trace_thread_interrupter) {
83 OS::Print("ThreadInterrupter resuming %p\n", 88 OS::Print("ThreadInterrupter resuming %p\n",
84 reinterpret_cast<void*>(state->id)); 89 reinterpret_cast<void*>(state->id));
85 } 90 }
86 } 91 }
87 } 92 }
88 93
89 94
90 void ThreadInterrupter::InstallSignalHandler() { 95 void ThreadInterrupter::InstallSignalHandler() {
91 // Nothing to do on Windows. 96 // Nothing to do on Windows.
92 } 97 }
93 98
94 99
95 } // namespace dart 100 } // namespace dart
96 101
97 #endif // defined(TARGET_OS_WINDOWS) 102 #endif // defined(TARGET_OS_WINDOWS)
98 103
OLDNEW
« runtime/vm/thread_interrupter.cc ('K') | « runtime/vm/thread_interrupter_macos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698