diff options
author | Kenneth Russel <[email protected]> | 2005-05-10 16:23:35 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-05-10 16:23:35 +0000 |
commit | 235ecf635f427a3be2956ecb83e8049d5a693d79 (patch) | |
tree | 8d0df1206cedd4afd331a368b2dc062ac66d6fb3 /src/demos/jrefract | |
parent | 7b17f6f020c4c58c50e42da800a1ceb34a5b3cbf (diff) |
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
Diffstat (limited to 'src/demos/jrefract')
-rwxr-xr-x | src/demos/jrefract/JRefract.java | 22 |
1 files changed, 13 insertions, 9 deletions
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) { } } |