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

Commit 1ec52908 authored by Hans Boehm's avatar Hans Boehm
Browse files

Remove unnecessary getpriority() system call

This was introduced for a valid reason in aosp/1224543, but that reason
was later removed. This code wasn't.

It is not worth making a system call in order to possibly avoid a second
one, which I expect is no more expensive in that, particularly easy,
case.

Test: Treehugger
Change-Id: I346f9b641c6feb791247b16fb900a4ad97e646d2
parent 65daca3b
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -313,11 +313,6 @@ void androidSetCreateThreadFunc(android_create_thread_fn func)
int androidSetThreadPriority(pid_t tid, int pri)
{
    int rc = 0;
    int curr_pri = getpriority(PRIO_PROCESS, tid);

    if (curr_pri == pri) {
        return rc;
    }

    if (setpriority(PRIO_PROCESS, tid, pri) < 0) {
        rc = INVALID_OPERATION;