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.
This commit is contained in:
kappa1 2010-07-09 19:37:14 +00:00
parent 0ddafa3842
commit b911005854
1 changed files with 5 additions and 4 deletions

View File

@ -424,12 +424,13 @@ public final class Display {
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 ) {