From 7dee7a38baafcbdd26ff116eeec862ec661dedec Mon Sep 17 00:00:00 2001 From: Jack Palevich Date: Tue, 10 Apr 2012 05:56:19 -0700 Subject: Notify monitor waiters when changing mSurfaceIsBad value. Otherwise the waiters might not wake up, leading to ANRs. Bug: 6307843 Change-Id: I0646b4e8368f80dbff46342f75709992796973fd --- opengl/java/android/opengl/GLSurfaceView.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'opengl') diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index c937a09..2a4d59b 100644 --- a/opengl/java/android/opengl/GLSurfaceView.java +++ b/opengl/java/android/opengl/GLSurfaceView.java @@ -1459,7 +1459,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback Log.w("GLThread", "egl createSurface"); } if (!mEglHelper.createSurface()) { - mSurfaceIsBad = true; + synchronized(sGLThreadManager) { + mSurfaceIsBad = true; + sGLThreadManager.notifyAll(); + } continue; } createEglSurface = false; @@ -1519,7 +1522,11 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback // but we haven't been notified yet. // Log the error to help developers understand why rendering stopped. EglHelper.logEglErrorAsWarning("GLThread", "eglSwapBuffers", swapError); - mSurfaceIsBad = true; + + synchronized(sGLThreadManager) { + mSurfaceIsBad = true; + sGLThreadManager.notifyAll(); + } break; } -- cgit v1.1