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

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

Issue 1284223003: Don't crash on SIGPROF from foreign sources. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | 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/thread_interrupter.h" 5 #include "vm/thread_interrupter.h"
6 6
7 #include "vm/flags.h" 7 #include "vm/flags.h"
8 #include "vm/lockers.h" 8 #include "vm/lockers.h"
9 #include "vm/os.h" 9 #include "vm/os.h"
10 #include "vm/simulator.h" 10 #include "vm/simulator.h"
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 } 219 }
220 } 220 }
221 221
222 222
223 InterruptableThreadState* ThreadInterrupter::GetCurrentThreadState() { 223 InterruptableThreadState* ThreadInterrupter::GetCurrentThreadState() {
224 return _EnsureThreadStateCreated(); 224 return _EnsureThreadStateCreated();
225 } 225 }
226 226
227 227
228 InterruptableThreadState* ThreadInterrupter::CurrentThreadState() { 228 InterruptableThreadState* ThreadInterrupter::CurrentThreadState() {
229 return Thread::Current()->thread_state(); 229 Thread* thread = Thread::Current();
230 return (thread == NULL) ? NULL : thread->thread_state();
230 } 231 }
231 232
232 233
233 void ThreadInterrupter::SetCurrentThreadState(InterruptableThreadState* state) { 234 void ThreadInterrupter::SetCurrentThreadState(InterruptableThreadState* state) {
234 Thread::Current()->set_thread_state(state); 235 Thread::Current()->set_thread_state(state);
235 } 236 }
236 237
237 238
238 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data) { 239 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data) {
239 // NoOp. 240 // NoOp.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 313 }
313 { 314 {
314 // Signal to main thread we are exiting. 315 // Signal to main thread we are exiting.
315 MonitorLocker shutdown_ml(monitor_); 316 MonitorLocker shutdown_ml(monitor_);
316 thread_running_ = false; 317 thread_running_ = false;
317 shutdown_ml.Notify(); 318 shutdown_ml.Notify();
318 } 319 }
319 } 320 }
320 321
321 } // namespace dart 322 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698