| 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/globals.h" | 9 #include "vm/globals.h" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 // NOTE: Destructor currently ignored on Windows (issue 23474). | 41 // NOTE: Destructor currently ignored on Windows (issue 23474). |
| 42 static ThreadLocalKey CreateThreadLocal(ThreadDestructor destructor = NULL); | 42 static ThreadLocalKey CreateThreadLocal(ThreadDestructor destructor = NULL); |
| 43 static void DeleteThreadLocal(ThreadLocalKey key); | 43 static void DeleteThreadLocal(ThreadLocalKey key); |
| 44 static uword GetThreadLocal(ThreadLocalKey key) { | 44 static uword GetThreadLocal(ThreadLocalKey key) { |
| 45 return ThreadInlineImpl::GetThreadLocal(key); | 45 return ThreadInlineImpl::GetThreadLocal(key); |
| 46 } | 46 } |
| 47 static void SetThreadLocal(ThreadLocalKey key, uword value); | 47 static void SetThreadLocal(ThreadLocalKey key, uword value); |
| 48 static intptr_t GetMaxStackSize(); | 48 static intptr_t GetMaxStackSize(); |
| 49 static ThreadId GetCurrentThreadId(); | 49 static ThreadId GetCurrentThreadId(); |
| 50 static intptr_t CurrentCurrentThreadIdAsIntPtr() { |
| 51 return ThreadIdToIntPtr(GetCurrentThreadId()); |
| 52 } |
| 50 static bool Join(ThreadId id); | 53 static bool Join(ThreadId id); |
| 51 static intptr_t ThreadIdToIntPtr(ThreadId id); | 54 static intptr_t ThreadIdToIntPtr(ThreadId id); |
| 52 static ThreadId ThreadIdFromIntPtr(intptr_t id); | 55 static ThreadId ThreadIdFromIntPtr(intptr_t id); |
| 53 static bool Compare(ThreadId a, ThreadId b); | 56 static bool Compare(ThreadId a, ThreadId b); |
| 54 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); | 57 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); |
| 55 }; | 58 }; |
| 56 | 59 |
| 57 | 60 |
| 58 class Mutex { | 61 class Mutex { |
| 59 public: | 62 public: |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 MonitorData data_; // OS-specific data. | 110 MonitorData data_; // OS-specific data. |
| 108 | 111 |
| 109 DISALLOW_COPY_AND_ASSIGN(Monitor); | 112 DISALLOW_COPY_AND_ASSIGN(Monitor); |
| 110 }; | 113 }; |
| 111 | 114 |
| 112 | 115 |
| 113 } // namespace dart | 116 } // namespace dart |
| 114 | 117 |
| 115 | 118 |
| 116 #endif // VM_OS_THREAD_H_ | 119 #endif // VM_OS_THREAD_H_ |
| OLD | NEW |