diff options
author | Jack Palevich <jackpal@google.com> | 2012-04-10 05:56:19 -0700 |
---|---|---|
committer | Jack Palevich <jackpal@google.com> | 2012-04-10 06:05:42 -0700 |
commit | 7dee7a38baafcbdd26ff116eeec862ec661dedec (patch) | |
tree | d224d4d6becaeea454f8a38af58a5afd7e3031ce /opengl | |
parent | c38cf4c7dbe7d96255d42dabf8ca801830813f5e (diff) | |
download | frameworks_base-7dee7a38baafcbdd26ff116eeec862ec661dedec.zip frameworks_base-7dee7a38baafcbdd26ff116eeec862ec661dedec.tar.gz frameworks_base-7dee7a38baafcbdd26ff116eeec862ec661dedec.tar.bz2 |
Notify monitor waiters when changing mSurfaceIsBad value.
Otherwise the waiters might not wake up, leading to ANRs.
Bug: 6307843
Change-Id: I0646b4e8368f80dbff46342f75709992796973fd
Diffstat (limited to 'opengl')
-rw-r--r-- | opengl/java/android/opengl/GLSurfaceView.java | 11 |
1 files changed, 9 insertions, 2 deletions
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; } |