summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-06-26 08:36:16 -0700
committerSan Mehat <san@google.com>2009-06-26 11:10:58 -0700
commit3e371e2ebbeeefe176ba1357e6ff241bd13a711e (patch)
tree740648d059731a923f859702670ad9bca8c93eb3
parent7d8220a4d0193b85efd7d289cbff3617f56ef0a9 (diff)
downloadandroid_dalvik-3e371e2ebbeeefe176ba1357e6ff241bd13a711e.tar.gz
android_dalvik-3e371e2ebbeeefe176ba1357e6ff241bd13a711e.tar.bz2
android_dalvik-3e371e2ebbeeefe176ba1357e6ff241bd13a711e.zip
dalvik: thread: Set the control group of a thread to the background group
if the priority is logically-lower than ANDROID_PRIORITY_BACKGROUND Signed-off-by: San Mehat <san@google.com>
-rw-r--r--vm/Thread.c4
-rw-r--r--vm/alloc/Heap.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/vm/Thread.c b/vm/Thread.c
index acfc7a9df..0adde3878 100644
--- a/vm/Thread.c
+++ b/vm/Thread.c
@@ -2819,9 +2819,9 @@ void dvmChangeThreadPriority(Thread* thread, int newPriority)
}
newNice = kNiceValues[newPriority-1];
- if (newPriority == ANDROID_PRIORITY_BACKGROUND) {
+ if (newPriority >= ANDROID_PRIORITY_BACKGROUND) {
dvmChangeThreadSchedulerGroup("bg_non_interactive");
- } else if (getpriority(PRIO_PROCESS, pid) == ANDROID_PRIORITY_BACKGROUND) {
+ } else if (getpriority(PRIO_PROCESS, pid) >= ANDROID_PRIORITY_BACKGROUND) {
dvmChangeThreadSchedulerGroup(NULL);
}
diff --git a/vm/alloc/Heap.c b/vm/alloc/Heap.c
index 09954ea8b..e58a8a8c8 100644
--- a/vm/alloc/Heap.c
+++ b/vm/alloc/Heap.c
@@ -775,7 +775,7 @@ void dvmCollectGarbageInternal(bool collectSoftReferences)
* in backward UNIX terms means lower priority.
*/
- if (priorityResult == ANDROID_PRIORITY_BACKGROUND) {
+ if (priorityResult >= ANDROID_PRIORITY_BACKGROUND) {
dvmChangeThreadSchedulerGroup(NULL);
}
@@ -1025,7 +1025,7 @@ void dvmCollectGarbageInternal(bool collectSoftReferences)
LOGD_HEAP("Reset priority to %d\n", oldThreadPriority);
}
- if (oldThreadPriority == ANDROID_PRIORITY_BACKGROUND) {
+ if (oldThreadPriority >= ANDROID_PRIORITY_BACKGROUND) {
dvmChangeThreadSchedulerGroup("bg_non_interactive");
}
}