Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbe715b2 authored by Balamurugan Thanikachalam's avatar Balamurugan Thanikachalam Committed by Gerrit - the friendly Code Review server
Browse files

sched_getscheduler may include SCHED_RESET_ON_FORK

The SCHED_RESET_ON_FORK flag is visible in the policy value returned by
sched_getscheduler() - mask it to check the value for RT policies.

Change-Id: Ib39f15be2c95194a6cb00d45017e796eebe850ea
parent 3f4b141f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -241,7 +241,7 @@ void android_os_Process_setProcessGroup(JNIEnv* env, jobject clazz, int pid, jin
        t_pri = getpriority(PRIO_PROCESS, t_pid);

        if (t_pri <= ANDROID_PRIORITY_AUDIO) {
            int scheduler = sched_getscheduler(t_pid);
            int scheduler = sched_getscheduler(t_pid) & ~SCHED_RESET_ON_FORK;
            if ((scheduler == SCHED_FIFO) || (scheduler == SCHED_RR)) {
                // This task wants to stay in its current audio group so it can keep its budget
                // don't update its cpuset or cgroup