Bug 37 - GLJPanel + Animator.stop() halts event dispatch thread
Summary: GLJPanel + Animator.stop() halts event dispatch thread
Alias: None
Product: Jogl
Classification: JogAmp
Component: core (show other bugs)
Version: 1
Hardware: All all
: P3 normal
Assignee: Sven Gothel
Depends on:
Reported: 2003-09-07 07:09 CEST by Sven Gothel
Modified: 2010-03-24 07:45 CET (History)
0 users

See Also:
SCM Refs:
Workaround: ---


Note You need to log in before you can comment on or make changes to this bug.
Description Sven Gothel 2010-03-24 07:45:50 CET

---- Reported by gkw 2003-09-07 19:09:45 ----

The stop method of Animator class calls wait() to block the current thread until
the animation thread is finished.  This doesn't work with GLJPanel since both
threads are the same, the event dispatch thread.  Halting the event dispatch
thread puts the app into a coma.

This fix works but I don't know how correct it is.
/** Stops this animator, blocking until the animation thread has
      finished. */
  public synchronized void stop() {
    shouldStop = true;
    if( EventQueue.isDispatchThread() ) {
		while (shouldStop && thread != null) {
      try {
      } catch (InterruptedException e) {

---- Additional Comments From kbr 2005-02-03 00:11:23 ----

Sorry for not commenting on this bug until now. The heuristic for whether the
Animator should wait or not was updated in a recent JOGL release, but not a lot
of debugging was done for the GLJPanel case. Some recent work on the GLJPanel
has required revisiting of some of these issues and a similar fix to the one
mentioned below was just checked in.

--- Bug imported by sgothel@jausoft.com 2010-03-24 07:45 EDT  ---

This bug was previously known as _bug_ 37 at https://jogl.dev.java.net/bugs/show_bug.cgi?id=37