diff options
author | Jason Parks <jparks@google.com> | 2009-11-04 14:25:26 -0800 |
---|---|---|
committer | Jason Parks <jparks@google.com> | 2009-11-04 14:25:26 -0800 |
commit | 2867746d7b59579ecf7b2de41e42fc1ca88d04d9 (patch) | |
tree | 3060ea65ae476e8a2d866ce276efee571d725410 /libs/binder | |
parent | 7ed0ceeba54712f76e9a4f2dd4c9197d76813488 (diff) | |
download | frameworks_base-2867746d7b59579ecf7b2de41e42fc1ca88d04d9.zip frameworks_base-2867746d7b59579ecf7b2de41e42fc1ca88d04d9.tar.gz frameworks_base-2867746d7b59579ecf7b2de41e42fc1ca88d04d9.tar.bz2 |
When a thread is about to be put back onto the thread pool ensure that it is in the foreground cgroup.
Diffstat (limited to 'libs/binder')
-rw-r--r-- | libs/binder/IPCThreadState.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/libs/binder/IPCThreadState.cpp b/libs/binder/IPCThreadState.cpp index 86c3df6..d474571 100644 --- a/libs/binder/IPCThreadState.cpp +++ b/libs/binder/IPCThreadState.cpp @@ -422,31 +422,13 @@ void IPCThreadState::joinThreadPool(bool isMain) << getReturnString(cmd) << endl; } - bool isTainted = false; - - { - SchedPolicy policy; - get_sched_policy(getpid(), &policy); - - if (policy == SP_BACKGROUND) { - isTainted = true; - } - } result = executeCommand(cmd); - // Make sure that after executing the commands that we put the thread back into the - // default cgroup. - { - int pid = getpid(); - SchedPolicy policy; - get_sched_policy(pid, &policy); - - if (!isTainted && policy == SP_BACKGROUND) { - LOGW("*** THREAD %p (PID %p) was left in SP_BACKGROUND with a priority of %d\n", - (void*)pthread_self(), pid, getpriority(PRIO_PROCESS, pid)); - } - } + // Make sure that after executing the command that we put the thread back into the + // default cgroup. This is just a failsafe incase the thread's priority or cgroup was + // not properly restored. + set_sched_policy(getpid(), SP_FOREGROUND); } // Let this thread exit the thread pool if it is no longer |