summaryrefslogtreecommitdiffstats
path: root/libs/utils
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2011-07-05 15:08:31 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-05 15:08:31 -0700
commit4431c05f136bc1073b368221e3515aaf7fe8424e (patch)
treed93ce746f59b3bdd16dd3acae3de81676e21f802 /libs/utils
parent324a1f6a125637269d3955e5a0935d3eb873b015 (diff)
parent60d47796ccfb3db3ab73017897f648678daddc83 (diff)
downloadframeworks_base-4431c05f136bc1073b368221e3515aaf7fe8424e.zip
frameworks_base-4431c05f136bc1073b368221e3515aaf7fe8424e.tar.gz
frameworks_base-4431c05f136bc1073b368221e3515aaf7fe8424e.tar.bz2
Merge "Thread ID zero for androidSetThreadSchedulingGroup"
Diffstat (limited to 'libs/utils')
-rw-r--r--libs/utils/Threads.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp
index 15bb1d2..71352a8 100644
--- a/libs/utils/Threads.cpp
+++ b/libs/utils/Threads.cpp
@@ -316,6 +316,10 @@ int androidSetThreadSchedulingGroup(pid_t tid, int grp)
#if defined(HAVE_PTHREADS)
pthread_once(&gDoSchedulingGroupOnce, checkDoSchedulingGroup);
if (gDoSchedulingGroup) {
+ // set_sched_policy does not support tid == 0
+ if (tid == 0) {
+ tid = androidGetTid();
+ }
if (set_sched_policy(tid, (grp == ANDROID_TGROUP_BG_NONINTERACT) ?
SP_BACKGROUND : SP_FOREGROUND)) {
return PERMISSION_DENIED;