From: <ka...@us...> - 2010-07-09 19:37:21
|
Revision: 3369 http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3369&view=rev Author: kappa1 Date: 2010-07-09 19:37:14 +0000 (Fri, 09 Jul 2010) Log Message: ----------- Display sync modified to allow it to be interrupted. Thanks to bobjob for this, further thanks to MatthiasM for pointing out that the interrupt should not be swallowed. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2010-07-09 18:44:31 UTC (rev 3368) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2010-07-09 19:37:14 UTC (rev 3369) @@ -424,12 +424,13 @@ savedTimeLate = timeLate; } - while ( gapTo > timeNow + savedTimeLate ) { - try { + try { + while ( gapTo > timeNow + savedTimeLate ) { Thread.sleep(1); - } catch (InterruptedException e) { + timeNow = Sys.getTime(); } - timeNow = Sys.getTime(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); } synchronized ( GlobalLock.lock ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |