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

Commit 111148f6 authored by Mark Fasheh's avatar Mark Fasheh
Browse files

Fix for b/411488376

Loop back around for another check of the stack if we detect a quitting
condition during nextMessage(). Otherwise we may miss an item added in
between our stack drain and the setting of quitting to true.

Bug: 411488376
Flag: build.RELEASE_PACKAGE_MESSAGEQUEUE_IMPLEMENTATION
Test: atest MessageQueueTest
Change-Id: I12bc300db8c3660214769874bde08b08ea1fbc16
parent 85dde963
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -801,10 +801,8 @@ public final class MessageQueue {
            if (found == null) {
                if (getQuitting()) {
                    mNextPollTimeoutMillis = 0;
                    // State change will be Active->Active, so can immediately return here.
                    return null;
                } else if (next == null) {
                    /* No message to deliver, sleep indefinitely, unless quitting */
                    /* No message to deliver, sleep indefinitely */
                    mNextPollTimeoutMillis = -1;
                    nextOp = sStackStateParked;
                    if (DEBUG) {