OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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_H_ | 5 #ifndef VM_THREAD_H_ |
6 #define VM_THREAD_H_ | 6 #define VM_THREAD_H_ |
7 | 7 |
8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "vm/atomic.h" | 10 #include "vm/atomic.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 // must currently be called manually (issue 23474). | 138 // must currently be called manually (issue 23474). |
139 class Thread : public BaseThread { | 139 class Thread : public BaseThread { |
140 public: | 140 public: |
141 // The kind of task this thread is performing. Sampled by the profiler. | 141 // The kind of task this thread is performing. Sampled by the profiler. |
142 enum TaskKind { | 142 enum TaskKind { |
143 kUnknownTask = 0x0, | 143 kUnknownTask = 0x0, |
144 kMutatorTask = 0x1, | 144 kMutatorTask = 0x1, |
145 kCompilerTask = 0x2, | 145 kCompilerTask = 0x2, |
146 kSweeperTask = 0x4, | 146 kSweeperTask = 0x4, |
147 kMarkerTask = 0x8, | 147 kMarkerTask = 0x8, |
| 148 kFinalizerTask = 0x10, |
148 }; | 149 }; |
149 ~Thread(); | 150 ~Thread(); |
150 | 151 |
151 // The currently executing thread, or NULL if not yet initialized. | 152 // The currently executing thread, or NULL if not yet initialized. |
152 static Thread* Current() { | 153 static Thread* Current() { |
153 BaseThread* thread = OSThread::GetCurrentTLS(); | 154 BaseThread* thread = OSThread::GetCurrentTLS(); |
154 if (thread == NULL || thread->is_os_thread()) { | 155 if (thread == NULL || thread->is_os_thread()) { |
155 return NULL; | 156 return NULL; |
156 } | 157 } |
157 return reinterpret_cast<Thread*>(thread); | 158 return reinterpret_cast<Thread*>(thread); |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 // Disable thread interrupts. | 766 // Disable thread interrupts. |
766 class DisableThreadInterruptsScope : public StackResource { | 767 class DisableThreadInterruptsScope : public StackResource { |
767 public: | 768 public: |
768 explicit DisableThreadInterruptsScope(Thread* thread); | 769 explicit DisableThreadInterruptsScope(Thread* thread); |
769 ~DisableThreadInterruptsScope(); | 770 ~DisableThreadInterruptsScope(); |
770 }; | 771 }; |
771 | 772 |
772 } // namespace dart | 773 } // namespace dart |
773 | 774 |
774 #endif // VM_THREAD_H_ | 775 #endif // VM_THREAD_H_ |
OLD | NEW |