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

Commit 7fb28916 authored by John Reck's avatar John Reck
Browse files

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
parent 5c2bd27f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -728,8 +728,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall

    private void releaseSurfaces(boolean releaseSurfacePackage) {
        mAlpha = 1f;
        synchronized (mSurfaceControlLock) {
        mSurface.destroy();
        synchronized (mSurfaceControlLock) {
            if (mBlastBufferQueue != null) {
                mBlastBufferQueue.destroy();
                mBlastBufferQueue = null;