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

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

Issue 205713004: Add isolate tag-profile and better handling of errors (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
« no previous file with comments | « runtime/vm/thread_interrupter.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "vm/simulator.h" 5 #include "vm/simulator.h"
6 #include "vm/thread_interrupter.h" 6 #include "vm/thread_interrupter.h"
7 7
8 namespace dart { 8 namespace dart {
9 9
10 // Notes: 10 // Notes:
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data) { 213 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data) {
214 // NoOp. 214 // NoOp.
215 } 215 }
216 216
217 217
218 class ThreadInterrupterVisitIsolates : public IsolateVisitor { 218 class ThreadInterrupterVisitIsolates : public IsolateVisitor {
219 public: 219 public:
220 ThreadInterrupterVisitIsolates() { } 220 ThreadInterrupterVisitIsolates() { }
221 void VisitIsolate(Isolate* isolate) { 221 void VisitIsolate(Isolate* isolate) {
222 ASSERT(isolate != NULL); 222 ASSERT(isolate != NULL);
223 InterruptableThreadState* state = isolate->thread_state(); 223 isolate->ProfileInterrupt();
224 if (state == NULL) {
225 return;
226 }
227 ASSERT(state->id != Thread::kInvalidThreadId);
228 ThreadInterrupter::InterruptThread(state);
229 } 224 }
230 }; 225 };
231 226
232 227
233 void ThreadInterrupter::ThreadMain(uword parameters) { 228 void ThreadInterrupter::ThreadMain(uword parameters) {
234 ASSERT(initialized_); 229 ASSERT(initialized_);
235 InstallSignalHandler(); 230 InstallSignalHandler();
236 if (FLAG_trace_thread_interrupter) { 231 if (FLAG_trace_thread_interrupter) {
237 OS::Print("ThreadInterrupter thread running.\n"); 232 OS::Print("ThreadInterrupter thread running.\n");
238 } 233 }
(...skipping 17 matching lines...) Expand all
256 } 251 }
257 { 252 {
258 // Signal to main thread we are exiting. 253 // Signal to main thread we are exiting.
259 MonitorLocker shutdown_ml(monitor_); 254 MonitorLocker shutdown_ml(monitor_);
260 thread_running_ = false; 255 thread_running_ = false;
261 shutdown_ml.Notify(); 256 shutdown_ml.Notify();
262 } 257 }
263 } 258 }
264 259
265 } // namespace dart 260 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/thread_interrupter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698