diff --git a/project/java/GLSurfaceView_SDL.java b/project/java/GLSurfaceView_SDL.java index 93c3a465e..8cc5c8371 100644 --- a/project/java/GLSurfaceView_SDL.java +++ b/project/java/GLSurfaceView_SDL.java @@ -1059,14 +1059,21 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call } while (needToWait()) { //Log.v("SDL", "GLSurfaceView_SDL::run(): paused"); - try { - wait(500); - } catch(Exception e) { } + synchronized(this) { + try + { + wait(500); + } + catch(InterruptedException e) + { + Log.v("SDL", "GLSurfaceView_SDL::GLThread::SwapBuffers(): Who dared to interrupt my slumber?"); + Thread.interrupted(); // Clear the flag + } + } } synchronized (this) { - if (mDone) { + if (mDone) return false; - } // changed = mSizeChanged; w = mWidth; h = mHeight; @@ -1198,6 +1205,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call public void requestExitAndWait() { // don't call this from GLThread thread or it is a guaranteed // deadlock! + Log.v("SDL", "GLSurfaceView_SDL::requestExitAndWait()"); synchronized(this) { mDone = true; notify(); @@ -1205,7 +1213,7 @@ public class GLSurfaceView_SDL extends SurfaceView implements SurfaceHolder.Call try { join(); } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); + //Thread.currentThread().interrupt(); } } diff --git a/project/java/Video.java b/project/java/Video.java index 8885661a5..deba57b74 100644 --- a/project/java/Video.java +++ b/project/java/Video.java @@ -960,7 +960,12 @@ class DemoGLSurfaceView extends GLSurfaceView_SDL { try { mRenderer.wait(300L); // And sometimes the app decides not to render at all, so this timeout should not be big. - } catch (InterruptedException e) { } + } + catch (InterruptedException e) + { + Log.v("SDL", "DemoGLSurfaceView::limitEventRate(): Who dared to interrupt my slumber?"); + Thread.interrupted(); + } } } }