diff options
author | Sven Gothel <[email protected]> | 2015-07-27 20:05:09 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-07-27 20:05:09 +0200 |
commit | b0af5159bc6100a6262afe6b52f9092a207ac2b3 (patch) | |
tree | 8379e6a283fd3c5028889ef9ad0e96ed77c3c3c3 /src/newt | |
parent | 6ae08be1742e6d805b316c0d440364854a49e68f (diff) |
Bug 1181 - JOGL WebStart Applications using GLCanvas/AWT may Deadlock by two AWT-EDT on Java >= 1.8.0_45
Root cause:
- AWT Toolkit global Lock
Our locking scheme (AWT-EDT-1):
- Surface Lock
- sun.awt.SunToolkit.awtLock()
- Component.getGraphicsConfiguration() -> synchronized(Component.getTreeLock())
Other AWT-EDT-2 by Webstart:
- synchronized(Component.getTreeLock())
- sun.awt.SunToolkit.awtLock()
Results in a deadlock.
Solution:
- Issue Component.getGraphicsConfiguration() before awtLock(),
where Component.getGraphicsConfiguration() is being used to
detect possible reconfiguration.
- Also use updated AWTGraphicsConfiguration's GraphicsConfiguration
if no 'new' detection is required.
Diffstat (limited to 'src/newt')
-rw-r--r-- | src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java index 0a27f7f22..ae32fd164 100644 --- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java +++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java @@ -626,8 +626,8 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto } } } - private final boolean updatePixelScale() { - if( jawtWindow.updatePixelScale(true) ) { + private final boolean updatePixelScale(final GraphicsConfiguration gc) { + if( jawtWindow.updatePixelScale(gc, true) ) { final Window cWin = newtChild; final Window dWin = cWin.getDelegatedWindow(); if( dWin instanceof WindowImpl ) { @@ -718,6 +718,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto } else { NewtFactoryAWT.destroyNativeWindow(jawtWindow); jawtWindow=null; + awtConfig=null; destroyJAWTPending = false; } } @@ -747,7 +748,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto System.err.println("NewtCanvasAWT.reshape: "+x+"/"+y+" "+width+"x"+height); } if( validateComponent(true) ) { - if( !printActive && updatePixelScale() ) { + if( !printActive && updatePixelScale(getGraphicsConfiguration()) ) { // NOP } else { // newtChild.setSize(width, height); |