OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <limits.h> |
| 6 #include <mach/mach_init.h> |
| 7 #include <pthread.h> |
| 8 #include <sched.h> |
| 9 #include <stddef.h> |
| 10 #include <sys/_structs.h> |
| 11 #include <sys/errno.h> |
| 12 #include <time.h> |
| 13 |
5 #include "base/threading/platform_thread.h" | 14 #include "base/threading/platform_thread.h" |
6 | |
7 #include <errno.h> | |
8 #include <sched.h> | |
9 | |
10 #include "base/logging.h" | |
11 #include "base/safe_strerror_posix.h" | |
12 #include "base/scoped_ptr.h" | |
13 #include "base/threading/thread_restrictions.h" | 15 #include "base/threading/thread_restrictions.h" |
| 16 #include "build/build_config.h" |
14 | 17 |
15 #if defined(OS_MACOSX) | 18 #if defined(OS_MACOSX) |
16 #include <mach/mach.h> | |
17 #include <sys/resource.h> | 19 #include <sys/resource.h> |
18 #include <algorithm> | 20 #include <algorithm> |
19 #endif | 21 #endif |
20 | 22 |
21 #if defined(OS_LINUX) | 23 #if defined(OS_LINUX) |
22 #include <dlfcn.h> | 24 #include <dlfcn.h> |
23 #include <sys/prctl.h> | 25 #include <sys/prctl.h> |
24 #include <sys/syscall.h> | 26 #include <sys/syscall.h> |
25 #include <unistd.h> | 27 #include <unistd.h> |
26 #endif | 28 #endif |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // static | 218 // static |
217 void PlatformThread::Join(PlatformThreadHandle thread_handle) { | 219 void PlatformThread::Join(PlatformThreadHandle thread_handle) { |
218 // Joining another thread may block the current thread for a long time, since | 220 // Joining another thread may block the current thread for a long time, since |
219 // the thread referred to by |thread_handle| may still be running long-lived / | 221 // the thread referred to by |thread_handle| may still be running long-lived / |
220 // blocking tasks. | 222 // blocking tasks. |
221 base::ThreadRestrictions::AssertIOAllowed(); | 223 base::ThreadRestrictions::AssertIOAllowed(); |
222 pthread_join(thread_handle, NULL); | 224 pthread_join(thread_handle, NULL); |
223 } | 225 } |
224 | 226 |
225 } // namespace base | 227 } // namespace base |
OLD | NEW |