Chromium Code Reviews| 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 10 matching lines...) Expand all Loading... | |
| 21 namespace dart { | 21 namespace dart { |
| 22 | 22 |
| 23 class Thread { | 23 class Thread { |
| 24 public: | 24 public: |
| 25 typedef void (*ThreadStartFunction) (uword parameter); | 25 typedef void (*ThreadStartFunction) (uword parameter); |
| 26 | 26 |
| 27 // Start a thread running the specified function. Returns 0 if the | 27 // Start a thread running the specified function. Returns 0 if the |
| 28 // thread started successfuly and a system specific error code if | 28 // thread started successfuly and a system specific error code if |
| 29 // the thread failed to start. | 29 // the thread failed to start. |
| 30 static int Start(ThreadStartFunction function, uword parameters); | 30 static int Start(ThreadStartFunction function, uword parameters); |
| 31 | |
| 32 static ThreadLocalKey kInvalidThreadLocal; | |
|
siva
2012/02/06 19:29:37
data field is clubbed in with functions, shouldn't
Søren Gjesse
2012/02/07 09:13:59
Moved field and changed name to kUnsetThreadlocalK
| |
| 33 static ThreadLocalKey CreateThreadLocal(); | |
| 34 static void DeleteThreadLocal(ThreadLocalKey key); | |
| 35 static uword GetThreadLocal(ThreadLocalKey key); | |
| 36 static void SetThreadLocal(ThreadLocalKey key, uword value); | |
| 31 }; | 37 }; |
| 32 | 38 |
| 33 | 39 |
| 34 class Mutex { | 40 class Mutex { |
| 35 public: | 41 public: |
| 36 Mutex(); | 42 Mutex(); |
| 37 ~Mutex(); | 43 ~Mutex(); |
| 38 | 44 |
| 39 void Lock(); | 45 void Lock(); |
| 40 bool TryLock(); | 46 bool TryLock(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 72 private: | 78 private: |
| 73 MonitorData data_; // OS-specific data. | 79 MonitorData data_; // OS-specific data. |
| 74 | 80 |
| 75 DISALLOW_COPY_AND_ASSIGN(Monitor); | 81 DISALLOW_COPY_AND_ASSIGN(Monitor); |
| 76 }; | 82 }; |
| 77 | 83 |
| 78 } // namespace dart | 84 } // namespace dart |
| 79 | 85 |
| 80 | 86 |
| 81 #endif // PLATFORM_THREAD_H_ | 87 #endif // PLATFORM_THREAD_H_ |
| OLD | NEW |