diff options
| author | 2011-07-05 15:08:31 -0700 | |
|---|---|---|
| committer | 2011-07-05 15:08:31 -0700 | |
| commit | f44c896b091cbbea4a96a6c47ddd65f77ba54b32 (patch) | |
| tree | 4516f5a0e380d2ed4ab016fc27c6a157979ce163 /libs/utils/Threads.cpp | |
| parent | 3135e6e0f0f6099cf1890f6218fd05af03b47204 (diff) | |
| parent | ce63396effb32212501658c25f2ec6d1bd8b0307 (diff) | |
Merge "Thread ID zero for androidSetThreadSchedulingGroup"
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 15bb1d2262..71352a864f 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; |