summaryrefslogtreecommitdiff
path: root/libs/gui/BLASTBufferQueue.cpp
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2023-04-05 11:39:25 -0400
committer Leon Scroggins III <scroggo@google.com> 2023-04-05 11:49:59 -0400
commitfb7ed56c090725d2b39f85656e71febf637fc3e7 (patch)
tree1e30f9aa92460b006efb1ddbf5c7cfa16aaa5ce5 /libs/gui/BLASTBufferQueue.cpp
parented66a3586c303cd580f3dfc5d3eb40bfcddba568 (diff)
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
Diffstat (limited to 'libs/gui/BLASTBufferQueue.cpp')
0 files changed, 0 insertions, 0 deletions