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

Skip to content
Commit fb7ed56c authored by Leon Scroggins III's avatar Leon Scroggins III
Browse files

Avoid deadlock in MessageQueue::onNewVsyncSchedule

It is hard to reproduce, but if the
VSyncDispatchTimerQueueEntry::callback is called at just the right time,
it will set mRunning to true, then wait on MessageQueue's mVsync.mutex,
which was already locked by onNewVsyncSchedule. When
onNewVsyncScheduleLocked destructs the old VSyncCallbackRegistration, it
needs to wait until mRunning is set back to false. But
VSyncDispatchTimerQueueEntry::callback cannot do that until
MessageQueue::vsyncCallback can lock the mutex.

Avoid this deadlock by moving the old VSyncCallbackRegistration's
destruction until after mVsync.mutex is released.

Bug: 276367387
Test: infeasible
Change-Id: I86e66df59c64e81c4aa721a25250697f61237488
parent ed66a358
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment