OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_OS_THREAD_H_ | 5 #ifndef VM_OS_THREAD_H_ |
6 #define VM_OS_THREAD_H_ | 6 #define VM_OS_THREAD_H_ |
7 | 7 |
8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 static bool Compare(ThreadId a, ThreadId b); | 168 static bool Compare(ThreadId a, ThreadId b); |
169 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); | 169 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); |
170 | 170 |
171 // Called at VM startup and shutdown. | 171 // Called at VM startup and shutdown. |
172 static void InitOnce(); | 172 static void InitOnce(); |
173 | 173 |
174 static bool IsThreadInList(ThreadId join_id); | 174 static bool IsThreadInList(ThreadId join_id); |
175 | 175 |
176 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); | 176 static const intptr_t kStackSizeBuffer = (4 * KB * kWordSize); |
177 | 177 |
178 static ThreadLocalKey kUnsetThreadLocalKey; | 178 static const ThreadId kInvalidThreadId; |
179 static ThreadId kInvalidThreadId; | 179 static const ThreadJoinId kInvalidThreadJoinId; |
180 static ThreadJoinId kInvalidThreadJoinId; | |
181 | 180 |
182 private: | 181 private: |
183 // These methods should not be used in a generic way and hence | 182 // These methods should not be used in a generic way and hence |
184 // are private, they have been added to solve the problem of | 183 // are private, they have been added to solve the problem of |
185 // accessing the VM thread structure from an OSThread object | 184 // accessing the VM thread structure from an OSThread object |
186 // in the windows thread interrupter which is used for profiling. | 185 // in the windows thread interrupter which is used for profiling. |
187 // We could eliminate this requirement if the windows thread interrupter | 186 // We could eliminate this requirement if the windows thread interrupter |
188 // is implemented differently. | 187 // is implemented differently. |
189 Thread* thread() const { return thread_; } | 188 Thread* thread() const { return thread_; } |
190 void set_thread(Thread* value) { | 189 void set_thread(Thread* value) { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 #endif // defined(DEBUG) | 313 #endif // defined(DEBUG) |
315 | 314 |
316 DISALLOW_COPY_AND_ASSIGN(Monitor); | 315 DISALLOW_COPY_AND_ASSIGN(Monitor); |
317 }; | 316 }; |
318 | 317 |
319 | 318 |
320 } // namespace dart | 319 } // namespace dart |
321 | 320 |
322 | 321 |
323 #endif // VM_OS_THREAD_H_ | 322 #endif // VM_OS_THREAD_H_ |
OLD | NEW |