Fix deadlock that can occur when BBQ's destructor runs while the BQ lock is held
This change ensures we don't destroy a sp<BLASTBufferQueue> while the BufferQueue lock is held. Doing so can cause deadlock because BLASTBufferQueue's destructor calls methods that acquire the BufferQueue lock. To avoid creating / destroying sp<BLASTBufferQueue> while the BufferQueue lock is held, the BufferReleaseReader is given shared ownership across BBQBufferQueueCore, BBQBufferQueueProducer, and BLASTBufferQueue. This allows BBQBufferQueueCore and BBQBufferQueueProducer to use the BufferReleaseReader without obtaining a strong pointer to BBQ. Bug: 410458641 Flag: com.android.graphics.libgui.flags.buffer_release_channel Test: BLASTBufferQueueTest Change-Id: I3d5b6fc52fba0ba52d50863dea072ade63b9bd27
Loading
Please register or sign in to comment