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

Commit dbc8b64d authored by Shai Barack's avatar Shai Barack
Browse files

Slightly optimize same thread check

Checking equality to Thread.currentThread() is fast because ART keeps this instance
in a fixed offset from the value of the thread register.

ldr w0, [tr, #224]; Load Thread.currentThread() into w0

Flag: EXEMPT refactor
Change-Id: I8ad50a2ac63e68ea312b7ca6340aba20caa3480f
parent 2de609df
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -2899,9 +2899,8 @@ public final class MessageQueue {
                    + " now: " + SystemClock.uptimeMillis());
        }

        final Looper myLooper = Looper.myLooper();
        /* If we are running on the looper thread we can add directly to the priority queue */
        if (myLooper != null && myLooper.getQueue() == this) {
        if (Thread.currentThread() == mLooperThread) {
            if (getQuitting()) {
                logDeadThread(msg);
                return false;