From 235ecf635f427a3be2956ecb83e8049d5a693d79 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Tue, 10 May 2005 16:23:35 +0000 Subject: Fixed race condition in GLJPanel implementation and improved behavior of JRefract demo on Linux git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/jogl-demos/trunk@72 3298f667-5e0e-4b4a-8ed4-a3559d26a5f4 --- src/demos/jrefract/JRefract.java | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/demos/jrefract') diff --git a/src/demos/jrefract/JRefract.java b/src/demos/jrefract/JRefract.java index f562341..bc7606f 100755 --- a/src/demos/jrefract/JRefract.java +++ b/src/demos/jrefract/JRefract.java @@ -835,13 +835,6 @@ public class JRefract { } private void runExit() { - quit = true; - while (!animatorStopped) { - try { - Thread.sleep(1); - } catch (InterruptedException e) { - } - } // Note: calling System.exit() synchronously inside the draw, // reshape or init callbacks can lead to deadlocks on certain // platforms (in particular, X11) because the JAWT's locking @@ -849,6 +842,13 @@ public class JRefract { // the exit routine in another thread. new Thread(new Runnable() { public void run() { + quit = true; + while (!animatorStopped) { + try { + Thread.sleep(1); + } catch (InterruptedException e) { + } + } System.exit(0); } }).start(); @@ -879,6 +879,10 @@ public class JRefract { GLJPanel panel = (GLJPanel) iter.next(); panel.display(); } + try { + Thread.sleep(1); + } catch (InterruptedException e) { + } } } animatorStopped = true; @@ -1174,7 +1178,7 @@ public class JRefract { } try { - Thread.sleep(1000); + Thread.sleep(2000); } catch (InterruptedException e) { } @@ -1189,7 +1193,7 @@ public class JRefract { } try { - Thread.sleep(1000); + Thread.sleep(2000); } catch (InterruptedException e) { } } -- cgit v1.2.3