diff options
author | Kevin Rushforth <[email protected]> | 2004-08-05 18:00:08 +0000 |
---|---|---|
committer | Kevin Rushforth <[email protected]> | 2004-08-05 18:00:08 +0000 |
commit | d26cb0d2108158ef8e56d6cbeca917d41886cf0b (patch) | |
tree | ab5f6031436496c1e57813972ee07d01c5b841de /src | |
parent | 19dcc6877c3e32d1a2812709616f9a9de015a9f1 (diff) |
Issue number: 19
Fixed Issue 19 : Resizing off-screen Canvas3D hangs on Solaris
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@30 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src')
-rw-r--r-- | src/classes/share/javax/media/j3d/Canvas3D.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/classes/share/javax/media/j3d/Canvas3D.java b/src/classes/share/javax/media/j3d/Canvas3D.java index 4d23891..ba6016c 100644 --- a/src/classes/share/javax/media/j3d/Canvas3D.java +++ b/src/classes/share/javax/media/j3d/Canvas3D.java @@ -1757,6 +1757,15 @@ public class Canvas3D extends Canvas { if ((offScreenCanvasSize.width != bufferRetained.width) || (offScreenCanvasSize.height != bufferRetained.height)) { + // NOTE: the setOffScreenBuffer method really shouldn't + // make any GLX calls (which the native create/destroy + // OffScreenBuffer methods do). It should send a message + // to the Renderer thread and have it done there, although + // that would be problematic if called from a + // Behavior. As it is, there is a small, but non-zero + // chance of a similar bug cropping up for a system with + // multiple views and multiple on-screen canvases. + if (window != 0) { destroyOffScreenBuffer(ctx, screen.display, window); removeCtx(true); @@ -3948,7 +3957,11 @@ public class Canvas3D extends Canvas { new Long(screen.display), new Integer(window), new Long(ctx)}); - if (!offscreen) { + // Fix for Issue 19 + // Wait for the context to be freed unless called from + // a Behavior or from a Rendering thread + if (!(Thread.currentThread() instanceof BehaviorScheduler) && + !(Thread.currentThread() instanceof Renderer)) { while (ctxTimeStamp != 0) { MasterControl.threadYield(); } |