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

Skip to content
Commit 62da2f3e authored by Mark Fasheh's avatar Mark Fasheh
Browse files

MessageQueue tail tracking - fix wakeup logic

MessageQueue.enqueueMessage() may choose to wake the thread waiting in
MessageQueue.next() if it is waiting on a barrier but an async message
is inserted.  Specifically, we only wake if there are no async messages
in the queue before async message we are inserting.

The tail tracking optimization inadvertantly changed this logic to
'only wake if there are no async messages in the queue at all', which
could theoretically cause a missed wakeup if there is an async message
that comes after the one which we are inserting.

Fix this by reverting the logic in the non-tail insertion case to it's
prior state.

Bug: 326484732
Test: Boot and use phone with messagequeue tail tracking enabled and disabled
Test: atest MessageQueueTest
Change-Id: Id24bc5ddd7941f94dc06c39013d4bc21712d97a9
parent 0ca9cb73
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment