OSDN Git Service

Fix thread priorities for unstarted threads.
authorNarayan Kamath <narayan@google.com>
Tue, 7 Oct 2014 11:51:26 +0000 (12:51 +0100)
committerNarayan Kamath <narayan@google.com>
Thu, 6 Nov 2014 12:14:18 +0000 (12:14 +0000)
commit1bd326a5e2aaff06a5bcae9cb2c42a4e8de31401
tree14348760835c367931612e1bc38f4b15ba4db787
parent1d0611c7e6721bd9115d652da74d2584ff3f192b
Fix thread priorities for unstarted threads.

Calls to Thread.setPriority for unstarted threads now behave
similar to dalvik. Note that there's still some inconsistent
behaviour carried over from dalvik.

- high priority threads from bg_non_interactive processes are
  not always moved to the SP_FOREGROUND cgroup.
- we do not attempt to adjust the cgroup of a native thread
  that's attaching.

Note that on android, the system_server will change the
cgroups for all running threads in a process when it moves
into the foreground and background. It's by design that
threads in a background process can request to be moved
to the foreground by setting a higher priority.

bug: 17893086

Change-Id: I1662982b1c7b3ac509698e2e12c9768d082c8053
runtime/thread.cc
runtime/thread_android.cc
test/051-thread/expected.txt
test/051-thread/src/Main.java
test/051-thread/thread_test.cc [new file with mode: 0644]
test/Android.libarttest.mk