Merge "libcutils: remove sched_set/getscheduler"

am: e0bec6b11e

Change-Id: I3f9a133401ac8a85ba3c6fd220875066df99271a
This commit is contained in:
Wei Wang 2017-03-28 22:39:56 +00:00 committed by android-build-merger
commit 446cfa74ef

View file

@ -271,17 +271,9 @@ int get_sched_policy(int tid, SchedPolicy *policy)
return -1;
}
} else {
int rc = sched_getscheduler(tid);
if (rc < 0)
return -1;
else if (rc == SCHED_NORMAL)
*policy = SP_FOREGROUND;
else if (rc == SCHED_BATCH)
*policy = SP_BACKGROUND;
else {
errno = ERANGE;
return -1;
}
// In b/34193533, we removed bg_non_interactive cgroup, so now
// all threads are in FOREGROUND cgroup
*policy = SP_FOREGROUND;
}
return 0;
}
@ -428,14 +420,6 @@ int set_sched_policy(int tid, SchedPolicy policy)
return -errno;
}
} else {
struct sched_param param;
param.sched_priority = 0;
sched_setscheduler(tid,
(policy == SP_BACKGROUND) ?
SCHED_BATCH : SCHED_NORMAL,
&param);
}
if (__sys_supports_timerslack) {