| 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 PLATFORM_THREAD_H_ | 5 #ifndef PLATFORM_THREAD_H_ |
| 6 #define PLATFORM_THREAD_H_ | 6 #define PLATFORM_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 19 matching lines...) Expand all Loading... |
| 30 // thread started successfuly and a system specific error code if | 30 // thread started successfuly and a system specific error code if |
| 31 // the thread failed to start. | 31 // the thread failed to start. |
| 32 static int Start(ThreadStartFunction function, uword parameters); | 32 static int Start(ThreadStartFunction function, uword parameters); |
| 33 | 33 |
| 34 static ThreadLocalKey CreateThreadLocal(); | 34 static ThreadLocalKey CreateThreadLocal(); |
| 35 static void DeleteThreadLocal(ThreadLocalKey key); | 35 static void DeleteThreadLocal(ThreadLocalKey key); |
| 36 static uword GetThreadLocal(ThreadLocalKey key) { | 36 static uword GetThreadLocal(ThreadLocalKey key) { |
| 37 return ThreadInlineImpl::GetThreadLocal(key); | 37 return ThreadInlineImpl::GetThreadLocal(key); |
| 38 } | 38 } |
| 39 static void SetThreadLocal(ThreadLocalKey key, uword value); | 39 static void SetThreadLocal(ThreadLocalKey key, uword value); |
| 40 static intptr_t GetMaxStackSize(); |
| 40 }; | 41 }; |
| 41 | 42 |
| 42 | 43 |
| 43 class Mutex { | 44 class Mutex { |
| 44 public: | 45 public: |
| 45 Mutex(); | 46 Mutex(); |
| 46 ~Mutex(); | 47 ~Mutex(); |
| 47 | 48 |
| 48 void Lock(); | 49 void Lock(); |
| 49 bool TryLock(); | 50 bool TryLock(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 private: | 82 private: |
| 82 MonitorData data_; // OS-specific data. | 83 MonitorData data_; // OS-specific data. |
| 83 | 84 |
| 84 DISALLOW_COPY_AND_ASSIGN(Monitor); | 85 DISALLOW_COPY_AND_ASSIGN(Monitor); |
| 85 }; | 86 }; |
| 86 | 87 |
| 87 } // namespace dart | 88 } // namespace dart |
| 88 | 89 |
| 89 | 90 |
| 90 #endif // PLATFORM_THREAD_H_ | 91 #endif // PLATFORM_THREAD_H_ |
| OLD | NEW |