Merge "Check the isInUse with the lock held in MessageQueue" into rvc-dev
This commit is contained in:
@@ -550,11 +550,12 @@ public final class MessageQueue {
|
|||||||
if (msg.target == null) {
|
if (msg.target == null) {
|
||||||
throw new IllegalArgumentException("Message must have a target.");
|
throw new IllegalArgumentException("Message must have a target.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
synchronized (this) {
|
||||||
if (msg.isInUse()) {
|
if (msg.isInUse()) {
|
||||||
throw new IllegalStateException(msg + " This message is already in use.");
|
throw new IllegalStateException(msg + " This message is already in use.");
|
||||||
}
|
}
|
||||||
|
|
||||||
synchronized (this) {
|
|
||||||
if (mQuitting) {
|
if (mQuitting) {
|
||||||
IllegalStateException e = new IllegalStateException(
|
IllegalStateException e = new IllegalStateException(
|
||||||
msg.target + " sending message to a Handler on a dead thread");
|
msg.target + " sending message to a Handler on a dead thread");
|
||||||
|
|||||||
Reference in New Issue
Block a user