Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(472)

Side by Side Diff: base/threading/platform_thread_freebsd.cc

Issue 1214503002: Increase priority of raster threads on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <sched.h> 8 #include <sched.h>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 11 matching lines...) Expand all
22 namespace base { 22 namespace base {
23 23
24 namespace internal { 24 namespace internal {
25 25
26 namespace { 26 namespace {
27 #if !defined(OS_NACL) 27 #if !defined(OS_NACL)
28 const struct sched_param kRealTimePrio = {8}; 28 const struct sched_param kRealTimePrio = {8};
29 #endif 29 #endif
30 } // namespace 30 } // namespace
31 31
32 const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = { 32 const ThreadPriorityToNiceValuePair kThreadPriorityToNiceValueMap[4] = {
no sievers 2015/06/25 22:52:15 [4] -> [5]
aelias_OOO_until_Jul13 2015/06/25 23:49:13 Done.
33 {ThreadPriority::BACKGROUND, 10}, 33 {ThreadPriority::BACKGROUND, 10},
34 {ThreadPriority::UI_BACKGROUND, 9},
34 {ThreadPriority::NORMAL, 0}, 35 {ThreadPriority::NORMAL, 0},
35 {ThreadPriority::DISPLAY, -6}, 36 {ThreadPriority::DISPLAY, -6},
36 {ThreadPriority::REALTIME_AUDIO, -10}, 37 {ThreadPriority::REALTIME_AUDIO, -10},
37 } 38 }
38 39
39 bool SetThreadPriorityForPlatform(PlatformThreadHandle handle, 40 bool SetThreadPriorityForPlatform(PlatformThreadHandle handle,
40 ThreadPriority priority) { 41 ThreadPriority priority) {
41 #if !defined(OS_NACL) 42 #if !defined(OS_NACL)
42 // TODO(gab): Assess the correctness of using |pthread_self()| below instead 43 // TODO(gab): Assess the correctness of using |pthread_self()| below instead
43 // of |handle|. http://crbug.com/468793. 44 // of |handle|. http://crbug.com/468793.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 #if !defined(THREAD_SANITIZER) 95 #if !defined(THREAD_SANITIZER)
95 return 0; 96 return 0;
96 #else 97 #else
97 // ThreadSanitizer bloats the stack heavily. Evidence has been that the 98 // ThreadSanitizer bloats the stack heavily. Evidence has been that the
98 // default stack size isn't enough for some browser tests. 99 // default stack size isn't enough for some browser tests.
99 return 2 * (1 << 23); // 2 times 8192K (the default stack size on Linux). 100 return 2 * (1 << 23); // 2 times 8192K (the default stack size on Linux).
100 #endif 101 #endif
101 } 102 }
102 103
103 } // namespace base 104 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698