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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 break; | 174 break; |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 // static | 178 // static |
179 ThreadPriority PlatformThread::GetCurrentThreadPriority() { | 179 ThreadPriority PlatformThread::GetCurrentThreadPriority() { |
180 NOTIMPLEMENTED(); | 180 NOTIMPLEMENTED(); |
181 return ThreadPriority::NORMAL; | 181 return ThreadPriority::NORMAL; |
182 } | 182 } |
183 | 183 |
| 184 // static |
| 185 bool PlatformThread::SetChildThreadPriorityInCurrentProcess( |
| 186 PlatformThreadHandle thread_handle, |
| 187 PlatformThreadId tid, |
| 188 ThreadPriority priority) { |
| 189 NOTIMPLEMENTED(); |
| 190 return false; |
| 191 } |
| 192 |
184 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { | 193 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { |
185 #if defined(OS_IOS) | 194 #if defined(OS_IOS) |
186 return 0; | 195 return 0; |
187 #else | 196 #else |
188 // The Mac OS X default for a pthread stack size is 512kB. | 197 // The Mac OS X default for a pthread stack size is 512kB. |
189 // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses | 198 // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses |
190 // DEFAULT_STACK_SIZE for this purpose. | 199 // DEFAULT_STACK_SIZE for this purpose. |
191 // | 200 // |
192 // 512kB isn't quite generous enough for some deeply recursive threads that | 201 // 512kB isn't quite generous enough for some deeply recursive threads that |
193 // otherwise request the default stack size by specifying 0. Here, adopt | 202 // otherwise request the default stack size by specifying 0. Here, adopt |
(...skipping 19 matching lines...) Expand all Loading... |
213 static_cast<size_t>(stack_rlimit.rlim_cur)); | 222 static_cast<size_t>(stack_rlimit.rlim_cur)); |
214 } | 223 } |
215 return default_stack_size; | 224 return default_stack_size; |
216 #endif | 225 #endif |
217 } | 226 } |
218 | 227 |
219 void TerminateOnThread() { | 228 void TerminateOnThread() { |
220 } | 229 } |
221 | 230 |
222 } // namespace base | 231 } // namespace base |
OLD | NEW |