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 21 matching lines...) Expand all Loading... |
32 static ThreadJoinId kInvalidThreadJoinId; | 32 static ThreadJoinId kInvalidThreadJoinId; |
33 | 33 |
34 typedef void (*ThreadStartFunction) (uword parameter); | 34 typedef void (*ThreadStartFunction) (uword parameter); |
35 typedef void (*ThreadDestructor) (void* parameter); | 35 typedef void (*ThreadDestructor) (void* parameter); |
36 | 36 |
37 // Start a thread running the specified function. Returns 0 if the | 37 // Start a thread running the specified function. Returns 0 if the |
38 // thread started successfuly and a system specific error code if | 38 // thread started successfuly and a system specific error code if |
39 // the thread failed to start. | 39 // the thread failed to start. |
40 static int Start(ThreadStartFunction function, uword parameters); | 40 static int Start(ThreadStartFunction function, uword parameters); |
41 | 41 |
42 // NOTE: Destructor currently ignored on Windows (issue 23474). | |
43 static ThreadLocalKey CreateThreadLocal(ThreadDestructor destructor = NULL); | 42 static ThreadLocalKey CreateThreadLocal(ThreadDestructor destructor = NULL); |
44 static void DeleteThreadLocal(ThreadLocalKey key); | 43 static void DeleteThreadLocal(ThreadLocalKey key); |
45 static uword GetThreadLocal(ThreadLocalKey key) { | 44 static uword GetThreadLocal(ThreadLocalKey key) { |
46 return ThreadInlineImpl::GetThreadLocal(key); | 45 return ThreadInlineImpl::GetThreadLocal(key); |
47 } | 46 } |
48 static void SetThreadLocal(ThreadLocalKey key, uword value); | 47 static void SetThreadLocal(ThreadLocalKey key, uword value); |
49 static intptr_t GetMaxStackSize(); | 48 static intptr_t GetMaxStackSize(); |
50 static ThreadId GetCurrentThreadId(); | 49 static ThreadId GetCurrentThreadId(); |
51 static ThreadId GetCurrentThreadTraceId(); | 50 static ThreadId GetCurrentThreadTraceId(); |
52 static intptr_t CurrentCurrentThreadIdAsIntPtr() { | 51 static intptr_t CurrentCurrentThreadIdAsIntPtr() { |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 MonitorData data_; // OS-specific data. | 117 MonitorData data_; // OS-specific data. |
119 | 118 |
120 DISALLOW_COPY_AND_ASSIGN(Monitor); | 119 DISALLOW_COPY_AND_ASSIGN(Monitor); |
121 }; | 120 }; |
122 | 121 |
123 | 122 |
124 } // namespace dart | 123 } // namespace dart |
125 | 124 |
126 | 125 |
127 #endif // VM_OS_THREAD_H_ | 126 #endif // VM_OS_THREAD_H_ |
OLD | NEW |