| 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 BIN_THREAD_H_ | 5 #ifndef BIN_THREAD_H_ |
| 6 #define BIN_THREAD_H_ | 6 #define BIN_THREAD_H_ |
| 7 | 7 |
| 8 #include "platform/globals.h" | 8 #include "platform/globals.h" |
| 9 | 9 |
| 10 // Declare the OS-specific types ahead of defining the generic classes. | 10 // Declare the OS-specific types ahead of defining the generic classes. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 static uword GetThreadLocal(ThreadLocalKey key) { | 40 static uword GetThreadLocal(ThreadLocalKey key) { |
| 41 return ThreadInlineImpl::GetThreadLocal(key); | 41 return ThreadInlineImpl::GetThreadLocal(key); |
| 42 } | 42 } |
| 43 static void SetThreadLocal(ThreadLocalKey key, uword value); | 43 static void SetThreadLocal(ThreadLocalKey key, uword value); |
| 44 static intptr_t GetMaxStackSize(); | 44 static intptr_t GetMaxStackSize(); |
| 45 static ThreadId GetCurrentThreadId(); | 45 static ThreadId GetCurrentThreadId(); |
| 46 static bool Join(ThreadId id); | 46 static bool Join(ThreadId id); |
| 47 static intptr_t ThreadIdToIntPtr(ThreadId id); | 47 static intptr_t ThreadIdToIntPtr(ThreadId id); |
| 48 static bool Compare(ThreadId a, ThreadId b); | 48 static bool Compare(ThreadId a, ThreadId b); |
| 49 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); | 49 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); |
| 50 |
| 51 static void InitOnce(); |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 | 54 |
| 53 class Mutex { | 55 class Mutex { |
| 54 public: | 56 public: |
| 55 Mutex(); | 57 Mutex(); |
| 56 ~Mutex(); | 58 ~Mutex(); |
| 57 | 59 |
| 58 void Lock(); | 60 void Lock(); |
| 59 bool TryLock(); | 61 bool TryLock(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 96 |
| 95 DISALLOW_COPY_AND_ASSIGN(Monitor); | 97 DISALLOW_COPY_AND_ASSIGN(Monitor); |
| 96 }; | 98 }; |
| 97 | 99 |
| 98 | 100 |
| 99 } // namespace bin | 101 } // namespace bin |
| 100 } // namespace dart | 102 } // namespace dart |
| 101 | 103 |
| 102 | 104 |
| 103 #endif // BIN_THREAD_H_ | 105 #endif // BIN_THREAD_H_ |
| OLD | NEW |