This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static javax.swing.JFrame.EXIT_ON_CLOSE; | |
import javax.media.opengl.GLCapabilities; | |
import javax.media.opengl.GLProfile; | |
import javax.swing.JFrame; | |
import javax.swing.JPopupMenu; | |
import javax.swing.SwingUtilities; | |
import com.jogamp.newt.awt.NewtCanvasAWT; | |
import com.jogamp.newt.event.MouseAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static javax.swing.JFrame.EXIT_ON_CLOSE; | |
import javax.media.opengl.GLCapabilities; | |
import javax.media.opengl.GLProfile; | |
import javax.swing.JFrame; | |
import javax.swing.JPopupMenu; | |
import javax.swing.SwingUtilities; | |
import com.jogamp.newt.awt.NewtCanvasAWT; | |
import com.jogamp.newt.event.MouseAdapter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main( String[] args ) throws Exception | |
{ | |
GLAutoDrawable contextOwner = GLUtils.newOffscreenDrawable( GLProfile.GL2GL3 ); | |
GLContext context = contextOwner.getContext( ); | |
final JTabbedPane tabbedPane = new JTabbedPane( ); | |
JFrame frame = FrameUtils.newFrame( "AWT Deadlock Example", tabbedPane, JFrame.EXIT_ON_CLOSE ); | |
FrameUtils.showFrameCentered( frame ); | |
for ( int i = 0; i < 100; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"main-Display-.x11_:0-1-EDT-1" daemon prio=10 tid=0x00007f740c084000 nid=0x5616 waiting on condition [0x00007f7405b12000] | |
java.lang.Thread.State: WAITING (parking) | |
at sun.misc.Unsafe.park(Native Method) | |
- parking to wait for <0x00000006898883a8> (a java.util.concurrent.locks.ReentrantLock$NonfairSync) | |
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186) | |
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834) | |
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireQueued(AbstractQueuedSynchronizer.java:867) | |
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquire(AbstractQueuedSynchronizer.java:1197) | |
at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:214) | |
at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:290) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static <V> V callInterruptibly(Callable<V> callable) throws InterruptedException | |
{ | |
ExecutorService executor = Executors.newSingleThreadExecutor(new ThreadFactory() | |
{ | |
public Thread newThread(Runnable runnable) | |
{ | |
Thread thread = Executors.defaultThreadFactory().newThread(runnable); | |
thread.setDaemon(true); | |
return thread; | |
} |