aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-03-16 09:43:19 -0700
committerGlenn Kasten <gkasten@google.com>2012-04-20 10:31:50 -0700
commit69bfb1f099164ae7ba44b5d0f7ba7c47cbbafd4d (patch)
tree23bd2952b82061be604ddc9d2945b308c47c42a2 /include
parentc28cbb2c5abe9e93a75185dc7c9e4925a0f9a87a (diff)
downloadsystem_core-69bfb1f099164ae7ba44b5d0f7ba7c47cbbafd4d.tar.gz
system_core-69bfb1f099164ae7ba44b5d0f7ba7c47cbbafd4d.tar.bz2
system_core-69bfb1f099164ae7ba44b5d0f7ba7c47cbbafd4d.zip
Scheduling group cleanup - add comment, SP_DEFAULT
Also tid == 0 maps to gettid() on platforms that support it. This is needed by mediaserver code that was formerly using the old C++ API. Change-Id: I8baaa3e42315c9b924cec26b6da01e7cb69e0078
Diffstat (limited to 'include')
-rw-r--r--include/cutils/sched_policy.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cutils/sched_policy.h b/include/cutils/sched_policy.h
index 753a08c1..c6e4fc44 100644
--- a/include/cutils/sched_policy.h
+++ b/include/cutils/sched_policy.h
@@ -21,21 +21,26 @@
extern "C" {
#endif
+/* Keep in sync with THREAD_GROUP_* in frameworks/base/core/java/android/os/Process.java */
typedef enum {
+ SP_DEFAULT = -1,
SP_BACKGROUND = 0,
SP_FOREGROUND = 1,
SP_CNT,
SP_MAX = SP_CNT - 1,
+ SP_SYSTEM_DEFAULT = SP_FOREGROUND,
} SchedPolicy;
/* Assign thread tid to the cgroup associated with the specified policy.
* If the thread is a thread group leader, that is it's gettid() == getpid(),
* then the other threads in the same thread group are _not_ affected.
+ * On platforms which support gettid(), zero tid means current thread.
* Return value: 0 for success, or -errno for error.
*/
extern int set_sched_policy(int tid, SchedPolicy policy);
/* Return the policy associated with the cgroup of thread tid via policy pointer.
+ * On platforms which support gettid(), zero tid means current thread.
* Return value: 0 for success, or -1 for error and set errno.
*/
extern int get_sched_policy(int tid, SchedPolicy *policy);