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

Commit 55cbf5e4 authored by Patrick Williams's avatar Patrick Williams
Browse files

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
parent e2c01c5f
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