Fix deadlock

mSurface.destroy() may block on a HardwareRenderer if lockHardwareCanvas
is used. mSurfaceControlLock is also used on the RenderThread, so it cannot hold that lock when potentially calling into HardwareRenderer as this is a deadlock risk.

Fixes: 244616968
Test: guess
Change-Id: Iedb6f3ce80f47a67b4427550f27851c3b9e3e242
This commit is contained in:
John Reck
2022-11-23 16:15:39 -05:00
parent 5c2bd27f77
commit 7fb2891673

View File

@@ -728,8 +728,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
private void releaseSurfaces(boolean releaseSurfacePackage) {
mAlpha = 1f;
mSurface.destroy();
synchronized (mSurfaceControlLock) {
mSurface.destroy();
if (mBlastBufferQueue != null) {
mBlastBufferQueue.destroy();
mBlastBufferQueue = null;