| 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 RUNTIME_VM_THREAD_H_ | 5 #ifndef RUNTIME_VM_THREAD_H_ |
| 6 #define RUNTIME_VM_THREAD_H_ | 6 #define RUNTIME_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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 public: | 154 public: |
| 155 // The kind of task this thread is performing. Sampled by the profiler. | 155 // The kind of task this thread is performing. Sampled by the profiler. |
| 156 enum TaskKind { | 156 enum TaskKind { |
| 157 kUnknownTask = 0x0, | 157 kUnknownTask = 0x0, |
| 158 kMutatorTask = 0x1, | 158 kMutatorTask = 0x1, |
| 159 kCompilerTask = 0x2, | 159 kCompilerTask = 0x2, |
| 160 kSweeperTask = 0x4, | 160 kSweeperTask = 0x4, |
| 161 kMarkerTask = 0x8, | 161 kMarkerTask = 0x8, |
| 162 kFinalizerTask = 0x10, | 162 kFinalizerTask = 0x10, |
| 163 }; | 163 }; |
| 164 // Converts a TaskKind to its corresponding C-String name. |
| 165 static const char* TaskKindToCString(TaskKind kind); |
| 166 |
| 164 ~Thread(); | 167 ~Thread(); |
| 165 | 168 |
| 166 // The currently executing thread, or NULL if not yet initialized. | 169 // The currently executing thread, or NULL if not yet initialized. |
| 167 static Thread* Current() { | 170 static Thread* Current() { |
| 168 BaseThread* thread = OSThread::GetCurrentTLS(); | 171 BaseThread* thread = OSThread::GetCurrentTLS(); |
| 169 if (thread == NULL || thread->is_os_thread()) { | 172 if (thread == NULL || thread->is_os_thread()) { |
| 170 return NULL; | 173 return NULL; |
| 171 } | 174 } |
| 172 return reinterpret_cast<Thread*>(thread); | 175 return reinterpret_cast<Thread*>(thread); |
| 173 } | 176 } |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 // Disable thread interrupts. | 784 // Disable thread interrupts. |
| 782 class DisableThreadInterruptsScope : public StackResource { | 785 class DisableThreadInterruptsScope : public StackResource { |
| 783 public: | 786 public: |
| 784 explicit DisableThreadInterruptsScope(Thread* thread); | 787 explicit DisableThreadInterruptsScope(Thread* thread); |
| 785 ~DisableThreadInterruptsScope(); | 788 ~DisableThreadInterruptsScope(); |
| 786 }; | 789 }; |
| 787 | 790 |
| 788 } // namespace dart | 791 } // namespace dart |
| 789 | 792 |
| 790 #endif // RUNTIME_VM_THREAD_H_ | 793 #endif // RUNTIME_VM_THREAD_H_ |
| OLD | NEW |