Loading services/core/java/com/android/server/wm/WindowAnimator.java +4 −1 Original line number Diff line number Diff line Loading @@ -228,7 +228,10 @@ public class WindowAnimator { Slog.wtf(TAG, "Unhandled exception in Window Manager", e); } finally { if (transactionOpen) { mService.closeSurfaceTransaction(); // Do not hold window manager lock while closing the transaction, as this might be // blocking until the next frame, which can lead to total lock starvation. mService.closeSurfaceTransaction(false /* withLockHeld */); if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION animate"); } } Loading services/core/java/com/android/server/wm/WindowManagerService.java +16 −0 Original line number Diff line number Diff line Loading @@ -896,10 +896,26 @@ public class WindowManagerService extends IWindowManager.Stub } void closeSurfaceTransaction() { closeSurfaceTransaction(true /* withLockHeld */); } /** * Closes a surface transaction. * * @param withLockHeld Whether to acquire the window manager while doing so. In some cases * holding the lock my lead to starvation in WM in case closeTransaction * blocks and we call it repeatedly, like we do for animations. */ void closeSurfaceTransaction(boolean withLockHeld) { synchronized (mWindowMap) { if (mRoot.mSurfaceTraceEnabled) { mRoot.mRemoteEventTrace.closeSurfaceTransaction(); } if (withLockHeld) { SurfaceControl.closeTransaction(); } } if (!withLockHeld) { SurfaceControl.closeTransaction(); } } Loading Loading
services/core/java/com/android/server/wm/WindowAnimator.java +4 −1 Original line number Diff line number Diff line Loading @@ -228,7 +228,10 @@ public class WindowAnimator { Slog.wtf(TAG, "Unhandled exception in Window Manager", e); } finally { if (transactionOpen) { mService.closeSurfaceTransaction(); // Do not hold window manager lock while closing the transaction, as this might be // blocking until the next frame, which can lead to total lock starvation. mService.closeSurfaceTransaction(false /* withLockHeld */); if (SHOW_TRANSACTIONS) Slog.i(TAG, "<<< CLOSE TRANSACTION animate"); } } Loading
services/core/java/com/android/server/wm/WindowManagerService.java +16 −0 Original line number Diff line number Diff line Loading @@ -896,10 +896,26 @@ public class WindowManagerService extends IWindowManager.Stub } void closeSurfaceTransaction() { closeSurfaceTransaction(true /* withLockHeld */); } /** * Closes a surface transaction. * * @param withLockHeld Whether to acquire the window manager while doing so. In some cases * holding the lock my lead to starvation in WM in case closeTransaction * blocks and we call it repeatedly, like we do for animations. */ void closeSurfaceTransaction(boolean withLockHeld) { synchronized (mWindowMap) { if (mRoot.mSurfaceTraceEnabled) { mRoot.mRemoteEventTrace.closeSurfaceTransaction(); } if (withLockHeld) { SurfaceControl.closeTransaction(); } } if (!withLockHeld) { SurfaceControl.closeTransaction(); } } Loading