| 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 #ifndef VM_THREAD_INTERRUPTER_H_ | 5 #ifndef VM_THREAD_INTERRUPTER_H_ |
| 6 #define VM_THREAD_INTERRUPTER_H_ | 6 #define VM_THREAD_INTERRUPTER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/signal_handler.h" | 9 #include "vm/signal_handler.h" |
| 10 #include "vm/thread.h" | 10 #include "vm/thread.h" |
| 11 | 11 |
| 12 | 12 |
| 13 namespace dart { | 13 namespace dart { |
| 14 | 14 |
| 15 struct InterruptedThreadState { | 15 struct InterruptedThreadState { |
| 16 ThreadId tid; | 16 ThreadId tid; |
| 17 uintptr_t pc; | 17 uintptr_t pc; |
| 18 uintptr_t sp; | 18 uintptr_t csp; |
| 19 uintptr_t dsp; |
| 19 uintptr_t fp; | 20 uintptr_t fp; |
| 20 }; | 21 }; |
| 21 | 22 |
| 22 // When a thread is interrupted the thread specific interrupt callback will be | 23 // When a thread is interrupted the thread specific interrupt callback will be |
| 23 // invoked. Each callback is given an InterruptedThreadState and the user data | 24 // invoked. Each callback is given an InterruptedThreadState and the user data |
| 24 // pointer. When inside a thread interrupt callback doing any of the following | 25 // pointer. When inside a thread interrupt callback doing any of the following |
| 25 // is forbidden: | 26 // is forbidden: |
| 26 // * Accessing TLS. | 27 // * Accessing TLS. |
| 27 // * Allocating memory. | 28 // * Allocating memory. |
| 28 // * Taking a lock. | 29 // * Taking a lock. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 static void InstallSignalHandler(); | 92 static void InstallSignalHandler(); |
| 92 | 93 |
| 93 friend class ThreadInterrupterVisitIsolates; | 94 friend class ThreadInterrupterVisitIsolates; |
| 94 }; | 95 }; |
| 95 | 96 |
| 96 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data); | 97 void ThreadInterruptNoOp(const InterruptedThreadState& state, void* data); |
| 97 | 98 |
| 98 } // namespace dart | 99 } // namespace dart |
| 99 | 100 |
| 100 #endif // VM_THREAD_INTERRUPTER_H_ | 101 #endif // VM_THREAD_INTERRUPTER_H_ |
| OLD | NEW |