diff options
| author | Glenn Kasten <gkasten@google.com> | 2011-06-22 17:42:23 -0700 |
|---|---|---|
| committer | Alex Ray <aray@google.com> | 2013-07-30 13:56:57 -0700 |
| commit | 5e0243f4d6313419fdc3affc205b790a2a965208 (patch) | |
| tree | 4b4a0de4b4807d6a8273090e999f9b4bc0d94d49 /libs/utils | |
| parent | 7f57eac6a706b471f2dcadd15868797ea081306a (diff) | |
| download | system_core-5e0243f4d6313419fdc3affc205b790a2a965208.zip system_core-5e0243f4d6313419fdc3affc205b790a2a965208.tar.gz system_core-5e0243f4d6313419fdc3affc205b790a2a965208.tar.bz2 | |
Thread ID zero for androidSetThreadSchedulingGroup
Already implemented by androidSetThreadPriority but not documented
Change-Id: I85302b17092952065f3f3a4214d8d8abdd465dbd
Diffstat (limited to 'libs/utils')
| -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 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; |
