| 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 "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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 // Pop. | 345 // Pop. |
| 346 threads_size_--; | 346 threads_size_--; |
| 347 return state; | 347 return state; |
| 348 } | 348 } |
| 349 | 349 |
| 350 | 350 |
| 351 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data) { | 351 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data) { |
| 352 // NoOp. | 352 // NoOp. |
| 353 } | 353 } |
| 354 | 354 |
| 355 |
| 355 void ThreadInterrupter::ThreadMain(uword parameters) { | 356 void ThreadInterrupter::ThreadMain(uword parameters) { |
| 356 ASSERT(initialized_); | 357 ASSERT(initialized_); |
| 357 InstallSignalHandler(); | 358 InstallSignalHandler(); |
| 358 if (FLAG_trace_thread_interrupter) { | 359 if (FLAG_trace_thread_interrupter) { |
| 359 OS::Print("ThreadInterrupter thread running.\n"); | 360 OS::Print("ThreadInterrupter thread running.\n"); |
| 360 } | 361 } |
| 361 { | 362 { |
| 362 // Signal to main thread we are ready. | 363 // Signal to main thread we are ready. |
| 363 MonitorLocker startup_ml(monitor_); | 364 MonitorLocker startup_ml(monitor_); |
| 364 thread_running_ = true; | 365 thread_running_ = true; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 378 } | 379 } |
| 379 { | 380 { |
| 380 // Signal to main thread we are exiting. | 381 // Signal to main thread we are exiting. |
| 381 MonitorLocker shutdown_ml(monitor_); | 382 MonitorLocker shutdown_ml(monitor_); |
| 382 thread_running_ = false; | 383 thread_running_ = false; |
| 383 shutdown_ml.Notify(); | 384 shutdown_ml.Notify(); |
| 384 } | 385 } |
| 385 } | 386 } |
| 386 | 387 |
| 387 } // namespace dart | 388 } // namespace dart |
| OLD | NEW |