| 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 namespace dart { | 10 namespace dart { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 } | 50 } |
| 51 static void SetThreadLocal(ThreadLocalKey key, uword value); | 51 static void SetThreadLocal(ThreadLocalKey key, uword value); |
| 52 static intptr_t GetMaxStackSize(); | 52 static intptr_t GetMaxStackSize(); |
| 53 static ThreadId GetCurrentThreadId(); | 53 static ThreadId GetCurrentThreadId(); |
| 54 static bool Join(ThreadId id); | 54 static bool Join(ThreadId id); |
| 55 static intptr_t ThreadIdToIntPtr(ThreadId id); | 55 static intptr_t ThreadIdToIntPtr(ThreadId id); |
| 56 static bool Compare(ThreadId a, ThreadId b); | 56 static bool Compare(ThreadId a, ThreadId b); |
| 57 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); | 57 static void GetThreadCpuUsage(ThreadId thread_id, int64_t* cpu_usage); |
| 58 | 58 |
| 59 static void InitOnce(); | 59 static void InitOnce(); |
| 60 |
| 61 private: |
| 62 DISALLOW_ALLOCATION(); |
| 63 DISALLOW_IMPLICIT_CONSTRUCTORS(Thread); |
| 60 }; | 64 }; |
| 61 | 65 |
| 62 | 66 |
| 63 class Mutex { | 67 class Mutex { |
| 64 public: | 68 public: |
| 65 Mutex(); | 69 Mutex(); |
| 66 ~Mutex(); | 70 ~Mutex(); |
| 67 | 71 |
| 68 void Lock(); | 72 void Lock(); |
| 69 bool TryLock(); | 73 bool TryLock(); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 98 // Notify waiting threads. | 102 // Notify waiting threads. |
| 99 void Notify(); | 103 void Notify(); |
| 100 void NotifyAll(); | 104 void NotifyAll(); |
| 101 | 105 |
| 102 private: | 106 private: |
| 103 MonitorData data_; // OS-specific data. | 107 MonitorData data_; // OS-specific data. |
| 104 | 108 |
| 105 DISALLOW_COPY_AND_ASSIGN(Monitor); | 109 DISALLOW_COPY_AND_ASSIGN(Monitor); |
| 106 }; | 110 }; |
| 107 | 111 |
| 108 | |
| 109 } // namespace bin | 112 } // namespace bin |
| 110 } // namespace dart | 113 } // namespace dart |
| 111 | 114 |
| 112 | 115 |
| 113 #endif // BIN_THREAD_H_ | 116 #endif // BIN_THREAD_H_ |
| OLD | NEW |