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 #include <errno.h> | 7 #include <errno.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <sys/prctl.h> | 9 #include <sys/prctl.h> |
10 #include <sys/resource.h> | 10 #include <sys/resource.h> |
11 #include <sys/types.h> | 11 #include <sys/types.h> |
12 #include <unistd.h> | 12 #include <unistd.h> |
13 | 13 |
14 #include "base/android/jni_android.h" | 14 #include "base/android/jni_android.h" |
15 #include "base/android/thread_utils.h" | |
16 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
17 #include "base/logging.h" | 16 #include "base/logging.h" |
18 #include "base/threading/platform_thread_internal_posix.h" | 17 #include "base/threading/platform_thread_internal_posix.h" |
19 #include "base/threading/thread_id_name_manager.h" | 18 #include "base/threading/thread_id_name_manager.h" |
20 #include "base/tracked_objects.h" | 19 #include "base/tracked_objects.h" |
21 #include "jni/ThreadUtils_jni.h" | 20 #include "jni/ThreadUtils_jni.h" |
22 | 21 |
23 namespace base { | 22 namespace base { |
24 | 23 |
25 namespace internal { | 24 namespace internal { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { | 88 size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) { |
90 #if !defined(ADDRESS_SANITIZER) | 89 #if !defined(ADDRESS_SANITIZER) |
91 return 0; | 90 return 0; |
92 #else | 91 #else |
93 // AddressSanitizer bloats the stack approximately 2x. Default stack size of | 92 // AddressSanitizer bloats the stack approximately 2x. Default stack size of |
94 // 1Mb is not enough for some tests (see http://crbug.com/263749 for example). | 93 // 1Mb is not enough for some tests (see http://crbug.com/263749 for example). |
95 return 2 * (1 << 20); // 2Mb | 94 return 2 * (1 << 20); // 2Mb |
96 #endif | 95 #endif |
97 } | 96 } |
98 | 97 |
99 bool RegisterThreadUtils(JNIEnv* env) { | |
100 return RegisterNativesImpl(env); | |
101 } | |
102 | |
103 } // namespace base | 98 } // namespace base |
OLD | NEW |