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

Commit 5965cb27 authored by Jing Ji's avatar Jing Ji Committed by Automerger Merge Worker
Browse files

Merge "Check the isInUse with the lock held in MessageQueue" into rvc-dev am:...

Merge "Check the isInUse with the lock held in MessageQueue" into rvc-dev am: 04dc962d am: 793ee0ff

Change-Id: I261b17f890333bfa146ad3a3a12ba179542dd988
parents 0081a91c 793ee0ff
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -550,11 +550,12 @@ public final class MessageQueue {
        if (msg.target == null) {
            throw new IllegalArgumentException("Message must have a target.");
        }

        synchronized (this) {
            if (msg.isInUse()) {
                throw new IllegalStateException(msg + " This message is already in use.");
            }

        synchronized (this) {
            if (mQuitting) {
                IllegalStateException e = new IllegalStateException(
                        msg.target + " sending message to a Handler on a dead thread");