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, | |
149 }; | 148 }; |
150 ~Thread(); | 149 ~Thread(); |
151 | 150 |
152 // The currently executing thread, or NULL if not yet initialized. | 151 // The currently executing thread, or NULL if not yet initialized. |
153 static Thread* Current() { | 152 static Thread* Current() { |
154 BaseThread* thread = OSThread::GetCurrentTLS(); | 153 BaseThread* thread = OSThread::GetCurrentTLS(); |
155 if (thread == NULL || thread->is_os_thread()) { | 154 if (thread == NULL || thread->is_os_thread()) { |
156 return NULL; | 155 return NULL; |
157 } | 156 } |
158 return reinterpret_cast<Thread*>(thread); | 157 return reinterpret_cast<Thread*>(thread); |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 // Disable thread interrupts. | 765 // Disable thread interrupts. |
767 class DisableThreadInterruptsScope : public StackResource { | 766 class DisableThreadInterruptsScope : public StackResource { |
768 public: | 767 public: |
769 explicit DisableThreadInterruptsScope(Thread* thread); | 768 explicit DisableThreadInterruptsScope(Thread* thread); |
770 ~DisableThreadInterruptsScope(); | 769 ~DisableThreadInterruptsScope(); |
771 }; | 770 }; |
772 | 771 |
773 } // namespace dart | 772 } // namespace dart |
774 | 773 |
775 #endif // VM_THREAD_H_ | 774 #endif // VM_THREAD_H_ |
OLD | NEW |