diff options
author | 2011-06-22 17:42:23 -0700 | |
---|---|---|
committer | 2011-06-22 17:45:30 -0700 | |
commit | 60d47796ccfb3db3ab73017897f648678daddc83 (patch) | |
tree | 87e3bfde59e5edb34e139e15414d7e05ebab41f0 /libs/utils/Threads.cpp | |
parent | df02afe8355e1e7a6f8f02549f41a166c3ee6932 (diff) |
Thread ID zero for androidSetThreadSchedulingGroup
Already implemented by androidSetThreadPriority but not documented
Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
Diffstat (limited to 'libs/utils/Threads.cpp')
-rw-r--r-- | libs/utils/Threads.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/utils/Threads.cpp b/libs/utils/Threads.cpp index 15bb1d22627c..71352a864fee 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; |