From: Kenneth B. R. <kbr...@al...> - 2002-03-04 08:30:27
|
> How can I get the thread handle to GLAnimCanvas display() so I > can wait for the repaint using something like: repaintThread.join()? Currently there is no way to access the internal thread of the GLAnimCanvas. If you need to call join() you are probably trying to shut down. Try doing this cooperatively, by setting a flag in your GLEventListener (assuming you are using the listener model) and checking whether that flag has been set in your display() method, calling GLAnimCanvas.stop() from there, and returning). You could use an external synchronization object if you want to be able to wait() until the target thread has stopped. See Doug Lea's Concurrent Programming in Java web site at http://g.oswego.edu/dl/cpj/ Alternatively you could change the GLAnimCanvas implementation to do this (instead of losing the reference to the internal thread) and also provide a join() method. If you decide to do this, get the latest sources via CVS (see http://sourceforge.net/projects/gl4java/ ) and we'll incorporate the changes into the main tree. |