我刚刚从Oracle JDK 1.6切换到Open JDK 1.7.0_03,并且在退出时遇到了相当显着的死锁:
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Thread.join(Thread.java:1258)
- locked <0x8608dda0> (a sun.awt.X11.XToolkit$1$1)
at java.lang.Thread.join(Thread.java:1332)
at java.lang.ApplicationShutdownHooks.runHooks(ApplicationShutdownHooks.java:106)
at java.lang.ApplicationShutdownHooks$1.run(ApplicationShutdownHooks.java:46)
at java.lang.Shutdown.runHooks(Shutdown.java:123)
at java.lang.Shutdown.sequence(Shutdown.java:167)
at java.lang.Shutdown.exit(Shutdown.java:212)
- locked <0x8603df28> (a java.lang.Class for java.lang.Shutdown)
at java.lang.Runtime.exit(Runtime.java:107)
at java.lang.System.exit(System.java:960)
您似乎必须从AWT事件队列中调用System.exit.这是真的吗? Sun docs Runtime.exit中没有线程要求的文档
我遇到了其他令人惊讶的情况,只有在Linux上才能获得AWT树锁,但是这个需要蛋糕.这是一个错误,还是我错过了文档中的内容?
最佳答案