我在Java领域非常新。最近,我遇到了一个Java应用程序由于某些问题而挂起的问题。当我进行线程转储时,我发现该特定线程使成千上万的阻塞计数。
"Thread-1" #12 daemon prio=5 os_prio=0 tid=0x0000000018392800 nid=0x2de0 waiting on condition [0x0000000018ece000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000a1da8db8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at java.util.concurrent.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:492)
at com.sun.glass.ui.InvokeLaterDispatcher.run(InvokeLaterDispatcher.java:108)
Locked ownable synchronizers:
- None
&有时在应用程序挂起后,线程更改为-
"Thread-1" #12 daemon prio=5 os_prio=0 tid=0x0000000018392800 nid=0x2de0 in Object.wait() [0x0000000018ece000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:502)
at com.sun.glass.ui.InvokeLaterDispatcher.run(InvokeLaterDispatcher.java:126)
- locked <0x00000000a1d65960> (a java.lang.StringBuilder)
Locked ownable synchronizers:
- None
因为它是一个已编译的jar文件,而且我不知道Java的各个方面都可以搜索这个微粒线程。是否可以使外部类文件停止或终止该执行线程以停止应用程序挂起。