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

Commit 6d46d35e authored by Shai Barack's avatar Shai Barack Committed by Android (Google) Code Review
Browse files

Merge "Check, reset, and restore interrupted state correctly while looping around park()" into main

parents c3346923 10bc73e6
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -2701,8 +2701,16 @@ public final class MessageQueue {
            return false;
        }
        mLooperThread = Thread.currentThread();
        boolean wasInterrupted = false;
        try {
            while ((mQuittingRefCountValue & ~QUITTING_MASK) != 0) {
                LockSupport.park();
                wasInterrupted |= Thread.interrupted();
            }
        } finally {
            if (wasInterrupted) {
                mLooperThread.interrupt();
            }
        }
        return true;
    }
+10 −3
Original line number Diff line number Diff line
@@ -280,9 +280,16 @@ public final class MessageQueue {
        if (!getQuitting()) {
            return false;
        }
        mLooperThread = Thread.currentThread();
        boolean wasInterrupted = false;
        try {
            while ((mQuittingRefCountValue & ~QUITTING_MASK) != 0) {
                LockSupport.park();
                wasInterrupted |= Thread.interrupted();
            }
        } finally {
            if (wasInterrupted) {
                mLooperThread.interrupt();
            }
        }
        return true;
    }