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
Loading
Please register or sign in to comment