OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/threading/platform_thread.h" | 5 #include "base/threading/platform_thread.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 #include <mach/mach.h> | 8 #include <mach/mach.h> |
9 #include <mach/mach_time.h> | 9 #include <mach/mach_time.h> |
10 #include <mach/thread_policy.h> | 10 #include <mach/thread_policy.h> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 break; | 166 break; |
167 case kThreadPriority_RealtimeAudio: | 167 case kThreadPriority_RealtimeAudio: |
168 SetPriorityRealtimeAudio(mach_thread_id); | 168 SetPriorityRealtimeAudio(mach_thread_id); |
169 break; | 169 break; |
170 default: | 170 default: |
171 NOTREACHED() << "Unknown priority."; | 171 NOTREACHED() << "Unknown priority."; |
172 break; | 172 break; |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
| 176 // static |
| 177 ThreadPriority PlatformThread::GetThreadPriority(PlatformThreadHandle handle) { |
| 178 NOTIMPLEMENTED(); |
| 179 return kThreadPriority_Normal; |
| 180 } |
| 181 |
176 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { | 182 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { |
177 #if defined(OS_IOS) | 183 #if defined(OS_IOS) |
178 return 0; | 184 return 0; |
179 #else | 185 #else |
180 // The Mac OS X default for a pthread stack size is 512kB. | 186 // The Mac OS X default for a pthread stack size is 512kB. |
181 // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses | 187 // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses |
182 // DEFAULT_STACK_SIZE for this purpose. | 188 // DEFAULT_STACK_SIZE for this purpose. |
183 // | 189 // |
184 // 512kB isn't quite generous enough for some deeply recursive threads that | 190 // 512kB isn't quite generous enough for some deeply recursive threads that |
185 // otherwise request the default stack size by specifying 0. Here, adopt | 191 // otherwise request the default stack size by specifying 0. Here, adopt |
(...skipping 22 matching lines...) Expand all Loading... |
208 #endif | 214 #endif |
209 } | 215 } |
210 | 216 |
211 void InitOnThread() { | 217 void InitOnThread() { |
212 } | 218 } |
213 | 219 |
214 void TerminateOnThread() { | 220 void TerminateOnThread() { |
215 } | 221 } |
216 | 222 |
217 } // namespace base | 223 } // namespace base |
OLD | NEW |