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

Commit 41c4bea2 authored by Christopher Tate's avatar Christopher Tate
Browse files

Don't accidentally signal multiple exceptions in setThreadPriority()

After signalling an exception due to set_sched_policy() failing (probably
because the thread in question had exited before this function was called), we
proceeded to call setpriority() anyway, and raised *another* exception when it
also failed.  We don't do this any more; we just bail after signalling the first
exception.

Change-Id: I397b6a93c73d3f0870176e26759f2bec33e56205
parent 48a65d99
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -285,6 +285,7 @@ void android_os_Process_setThreadPriority(JNIEnv* env, jobject clazz,

    if (rc) {
        signalExceptionForGroupError(env, clazz, errno);
        return;
    }

    if (setpriority(PRIO_PROCESS, pid, pri) < 0) {