先来看下以下代码:
public static void main(String[] args) throws IOException, InterruptedException { for (int i = 0; i < 100; i++) { new Thread(new SyncLockRunnable(1, 2)).start(); new Thread(new SyncLockRunnable(2, 1)).start(); } } static class SyncLockRunnable implements Runnable { int a, b; public SyncLockRunnable(int a, int b) { this.a = a; this.b = b; } @Override public void run() { synchronized (Integer.valueOf(a)) { synchronized (Integer.valueOf(b)) { System.out.println(a + b); } } } }
这段代码开了200个线程分别去计算1+2及2+1的值,其实FOR循环是可以省略的,两个线程也可能会导致死循环,不过那样概率太小,
需要尝试运行很多次才能看到效果。如果运气不是特别差得话,待FOR循环最多运行2~3次就会遇到线程死锁,程序无法结束。造成死锁的原因是Integer.valueOf()方法基于减少对象创建次数和节省内存的考虑,【-128,127】之间的数值会被缓存,当valueOf()方法在这个范围之内传入参数,将直接返回缓存中得对象。也就是说代码中带哦用了200次Integer.valueOf()方法一共就返回了两个不同的对象。假如在某个线程的两个synchronized块之间发生了一次线程切换,就会出现线程A等待线程B持有的Integer.valueOf(),线程B又等着线程A持由的对象锁,结果大家都跑不下去了。出现线程死锁之后,使用jconsole线程面板的“检测到死锁”的按钮,将会出现一个新的“死锁”页签。
也可以同时JDK自带dump线程工具查看如下:
jstack 9856
2014-03-29 11:35:32
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.65-b04-462 mixed mode):
"RMI TCP Connection(7)-127.0.0.1" daemon prio=9 tid=7fa81f97f000 nid=0x114d26000 runnable [114d25000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
- locked <7f33ca770> (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(FilterInputStream.java:66)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:517)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
"RMI TCP Connection(5)-127.0.0.1" daemon prio=9 tid=7fa81f049000 nid=0x114c23000 runnable [114c22000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read(BufferedInputStream.java:237)
- locked <7f44ffbd8> (a java.io.BufferedInputStream)
at java.io.FilterInputStream.read(FilterInputStream.java:66)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:517)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
"RMI TCP Connection(4)-127.0.0.1" daemon prio=9 tid=7fa81f042000 nid=0x114b20000 in Object.wait() [114b1e000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f44e7910> (a com.sun.jmx.remote.internal.ArrayNotificationBuffer)
at com.sun.jmx.remote.internal.ArrayNotificationBuffer.fetchNotifications(ArrayNotificationBuffer.java:437)
- locked <7f44e7910> (a com.sun.jmx.remote.internal.ArrayNotificationBuffer)
at com.sun.jmx.remote.internal.ArrayNotificationBuffer$ShareBuffer.fetchNotifications(ArrayNotificationBuffer.java:209)
at com.sun.jmx.remote.internal.ServerNotifForwarder.fetchNotifs(ServerNotifForwarder.java:259)
at javax.management.remote.rmi.RMIConnectionImpl$3.run(RMIConnectionImpl.java:1258)
at javax.management.remote.rmi.RMIConnectionImpl$3.run(RMIConnectionImpl.java:1256)
at javax.management.remote.rmi.RMIConnectionImpl.fetchNotifications(RMIConnectionImpl.java:1262)
at sun.reflect.GeneratedMethodAccessor86.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:303)
at sun.rmi.transport.Transport$1.run(Transport.java:159)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
"JMX server connection timeout 222" daemon prio=9 tid=7fa81d91e800 nid=0x114a1d000 in Object.wait() [114a1c000]
java.lang.Thread.State: TIMED_WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f44e1fa8> (a [I)
at com.sun.jmx.remote.internal.ServerCommunicatorAdmin$Timeout.run(ServerCommunicatorAdmin.java:150)
- locked <7f44e1fa8> (a [I)
at java.lang.Thread.run(Thread.java:695)
"RMI Scheduler(0)" daemon prio=9 tid=7fa81d91e000 nid=0x1147a8000 waiting on condition [1147a7000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <7f44e3088> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:196)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2025)
at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:609)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:602)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:957)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:917)
at java.lang.Thread.run(Thread.java:695)
"RMI TCP Accept-0" daemon prio=9 tid=7fa81e041000 nid=0x11459e000 runnable [11459d000]
java.lang.Thread.State: RUNNABLE
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:439)
- locked <7f44e94d0> (a java.net.SocksSocketImpl)
at java.net.ServerSocket.implAccept(ServerSocket.java:468)
at java.net.ServerSocket.accept(ServerSocket.java:436)
at sun.management.jmxremote.LocalRMIServerSocketFactory$1.accept(LocalRMIServerSocketFactory.java:34)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.executeAcceptLoop(TCPTransport.java:369)
at sun.rmi.transport.tcp.TCPTransport$AcceptLoop.run(TCPTransport.java:341)
at java.lang.Thread.run(Thread.java:695)
"AWT-AppKit" daemon prio=5 tid=7fa81f932800 nid=0x7fff78c79310 runnable [00000000]
java.lang.Thread.State: RUNNABLE
"Attach Listener" daemon prio=9 tid=7fa81f000000 nid=0x10880c000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"DestroyJavaVM" prio=5 tid=7fa81f927800 nid=0x100e11000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"Thread-200" prio=5 tid=7fa81d94d800 nid=0x10fa36000 waiting for monitor entry [10fa35000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-199" prio=5 tid=7fa81e138800 nid=0x10f933000 waiting for monitor entry [10f932000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-198" prio=5 tid=7fa81e138000 nid=0x10f830000 waiting for monitor entry [10f82f000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-197" prio=5 tid=7fa81e137000 nid=0x10f72d000 waiting for monitor entry [10f72c000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-196" prio=5 tid=7fa81e136800 nid=0x10f62a000 waiting for monitor entry [10f629000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-195" prio=5 tid=7fa81e135800 nid=0x10f527000 waiting for monitor entry [10f526000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-194" prio=5 tid=7fa81e135000 nid=0x10f424000 waiting for monitor entry [10f423000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-193" prio=5 tid=7fa81f927000 nid=0x10f321000 waiting for monitor entry [10f320000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-192" prio=5 tid=7fa81f1af800 nid=0x10f21e000 waiting for monitor entry [10f21d000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-191" prio=5 tid=7fa81f926000 nid=0x10f11b000 waiting for monitor entry [10f11a000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-190" prio=5 tid=7fa81d94c800 nid=0x10f018000 waiting for monitor entry [10f017000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-189" prio=5 tid=7fa81d94c000 nid=0x10ef15000 waiting for monitor entry [10ef14000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-188" prio=5 tid=7fa81f1af000 nid=0x10ee12000 waiting for monitor entry [10ee11000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-187" prio=5 tid=7fa81f925800 nid=0x10ed0f000 waiting for monitor entry [10ed0e000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-186" prio=5 tid=7fa81f924800 nid=0x10ec0c000 waiting for monitor entry [10ec0b000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-185" prio=5 tid=7fa81f924000 nid=0x10eb09000 waiting for monitor entry [10eb08000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-184" prio=5 tid=7fa81f923000 nid=0x10ea06000 waiting for monitor entry [10ea05000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-183" prio=5 tid=7fa81f922800 nid=0x10e903000 waiting for monitor entry [10e902000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-182" prio=5 tid=7fa81f1ae000 nid=0x10e800000 waiting for monitor entry [10e7ff000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-181" prio=5 tid=7fa81f921800 nid=0x10e6fd000 waiting for monitor entry [10e6fc000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-180" prio=5 tid=7fa81f921000 nid=0x10e5fa000 waiting for monitor entry [10e5f9000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-179" prio=5 tid=7fa81f920000 nid=0x10e4f7000 waiting for monitor entry [10e4f6000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-178" prio=5 tid=7fa81f91f800 nid=0x10e3f4000 waiting for monitor entry [10e3f3000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-177" prio=5 tid=7fa81f91e800 nid=0x10e2f1000 waiting for monitor entry [10e2f0000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-176" prio=5 tid=7fa81f91e000 nid=0x10e1ee000 waiting for monitor entry [10e1ed000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-175" prio=5 tid=7fa81f91d000 nid=0x10e0eb000 waiting for monitor entry [10e0ea000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-174" prio=5 tid=7fa81f91c800 nid=0x10dfe8000 waiting for monitor entry [10dfe7000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-173" prio=5 tid=7fa81f91b800 nid=0x10dee5000 waiting for monitor entry [10dee4000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-172" prio=5 tid=7fa81f91b000 nid=0x10dde2000 waiting for monitor entry [10dde1000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-171" prio=5 tid=7fa81f1ad800 nid=0x10dcdf000 waiting for monitor entry [10dcde000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-170" prio=5 tid=7fa81f91a000 nid=0x10dbdc000 waiting for monitor entry [10dbdb000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-169" prio=5 tid=7fa81f919800 nid=0x10dad9000 waiting for monitor entry [10dad8000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-168" prio=5 tid=7fa81f918800 nid=0x10d9d6000 waiting for monitor entry [10d9d5000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-167" prio=5 tid=7fa81f1ac800 nid=0x10d8d3000 waiting for monitor entry [10d8d2000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-166" prio=5 tid=7fa81e134000 nid=0x10d7d0000 waiting for monitor entry [10d7cf000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-165" prio=5 tid=7fa81f918000 nid=0x10d6cd000 waiting for monitor entry [10d6cc000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-164" prio=5 tid=7fa81f917000 nid=0x10d5ca000 waiting for monitor entry [10d5c9000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-163" prio=5 tid=7fa81d94b000 nid=0x10d4c7000 waiting for monitor entry [10d4c6000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-162" prio=5 tid=7fa81f916800 nid=0x10d3c4000 waiting for monitor entry [10d3c3000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-161" prio=5 tid=7fa81d94a800 nid=0x10d2c1000 waiting for monitor entry [10d2c0000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-160" prio=5 tid=7fa81f1ac000 nid=0x10d1be000 waiting for monitor entry [10d1bd000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-159" prio=5 tid=7fa81f915800 nid=0x10d0bb000 waiting for monitor entry [10d0ba000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-158" prio=5 tid=7fa81f93a000 nid=0x10cfb8000 waiting for monitor entry [10cfb7000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-157" prio=5 tid=7fa81d8bf800 nid=0x10ceb5000 waiting for monitor entry [10ceb4000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-156" prio=5 tid=7fa81f939000 nid=0x10cdb2000 waiting for monitor entry [10cdb1000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-155" prio=5 tid=7fa81f938800 nid=0x10ccaf000 waiting for monitor entry [10ccae000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-154" prio=5 tid=7fa81f937800 nid=0x10cbac000 waiting for monitor entry [10cbab000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-153" prio=5 tid=7fa81f937000 nid=0x10caa9000 waiting for monitor entry [10caa8000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-152" prio=5 tid=7fa81f936000 nid=0x10c9a6000 waiting for monitor entry [10c9a5000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-151" prio=5 tid=7fa81e133800 nid=0x10c8a3000 waiting for monitor entry [10c8a2000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-150" prio=5 tid=7fa81e152000 nid=0x10c7a0000 waiting for monitor entry [10c79f000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-149" prio=5 tid=7fa81e151800 nid=0x10c69d000 waiting for monitor entry [10c69c000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-148" prio=5 tid=7fa81e150800 nid=0x10c59a000 waiting for monitor entry [10c599000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-147" prio=5 tid=7fa81e150000 nid=0x10c497000 waiting for monitor entry [10c496000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-146" prio=5 tid=7fa81e14f000 nid=0x10c394000 waiting for monitor entry [10c393000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-145" prio=5 tid=7fa81e14e800 nid=0x10c291000 waiting for monitor entry [10c290000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-144" prio=5 tid=7fa81e14d800 nid=0x10c18e000 waiting for monitor entry [10c18d000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-143" prio=5 tid=7fa81e14d000 nid=0x10c08b000 waiting for monitor entry [10c08a000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-142" prio=5 tid=7fa81e14c000 nid=0x10bf88000 waiting for monitor entry [10bf87000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-141" prio=5 tid=7fa81e14b800 nid=0x10be85000 waiting for monitor entry [10be84000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-140" prio=5 tid=7fa81e046000 nid=0x10bd82000 waiting for monitor entry [10bd81000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-139" prio=5 tid=7fa81e045800 nid=0x10bc7f000 waiting for monitor entry [10bc7e000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-138" prio=5 tid=7fa81f1ab000 nid=0x10bb7c000 waiting for monitor entry [10bb7b000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-137" prio=5 tid=7fa81f935800 nid=0x10ba79000 waiting for monitor entry [10ba78000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-136" prio=5 tid=7fa81e043000 nid=0x10b976000 waiting for monitor entry [10b975000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-135" prio=5 tid=7fa81e042000 nid=0x10b873000 waiting for monitor entry [10b872000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-134" prio=5 tid=7fa81f934800 nid=0x10b770000 waiting for monitor entry [10b76f000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-133" prio=5 tid=7fa81f934000 nid=0x10b66d000 waiting for monitor entry [10b66c000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-132" prio=5 tid=7fa81d949800 nid=0x10b56a000 waiting for monitor entry [10b569000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-131" prio=5 tid=7fa81f933000 nid=0x10b467000 waiting for monitor entry [10b466000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-130" prio=5 tid=7fa81f90c000 nid=0x10b364000 waiting for monitor entry [10b363000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-129" prio=5 tid=7fa81f90b800 nid=0x10b261000 waiting for monitor entry [10b260000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-128" prio=5 tid=7fa81f90a800 nid=0x10b15e000 waiting for monitor entry [10b15d000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-127" prio=5 tid=7fa81f90a000 nid=0x10b05b000 waiting for monitor entry [10b05a000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-126" prio=5 tid=7fa81f909000 nid=0x10af58000 waiting for monitor entry [10af57000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-125" prio=5 tid=7fa81f908800 nid=0x10ae55000 waiting for monitor entry [10ae54000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-124" prio=5 tid=7fa81f907800 nid=0x10ad52000 waiting for monitor entry [10ad51000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-123" prio=5 tid=7fa81f907000 nid=0x10ac4f000 waiting for monitor entry [10ac4e000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-122" prio=5 tid=7fa81f906000 nid=0x10ab4c000 waiting for monitor entry [10ab4b000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-121" prio=5 tid=7fa81f905800 nid=0x10aa49000 waiting for monitor entry [10aa48000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-120" prio=5 tid=7fa81f052800 nid=0x10a946000 waiting for monitor entry [10a945000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-119" prio=5 tid=7fa81f94a000 nid=0x10a843000 waiting for monitor entry [10a842000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-118" prio=5 tid=7fa81f052000 nid=0x10a740000 waiting for monitor entry [10a73f000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-117" prio=5 tid=7fa81f051000 nid=0x10a63d000 waiting for monitor entry [10a63c000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-116" prio=5 tid=7fa81f949000 nid=0x10a53a000 waiting for monitor entry [10a539000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-115" prio=5 tid=7fa81f948800 nid=0x10a437000 waiting for monitor entry [10a436000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-114" prio=5 tid=7fa81f947800 nid=0x10a334000 waiting for monitor entry [10a333000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-113" prio=5 tid=7fa81f947000 nid=0x10a231000 waiting for monitor entry [10a230000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-112" prio=5 tid=7fa81f946000 nid=0x10a12e000 waiting for monitor entry [10a12d000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-111" prio=5 tid=7fa81f945800 nid=0x10a02b000 waiting for monitor entry [10a02a000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-110" prio=5 tid=7fa81f944800 nid=0x109f28000 waiting for monitor entry [109f27000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-109" prio=5 tid=7fa81f050800 nid=0x109e25000 waiting for monitor entry [109e24000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-108" prio=5 tid=7fa81f959800 nid=0x109d22000 waiting for monitor entry [109d21000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-107" prio=5 tid=7fa81f959000 nid=0x109c1f000 waiting for monitor entry [109c1e000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-106" prio=5 tid=7fa81f958000 nid=0x109813000 waiting for monitor entry [109812000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-105" prio=5 tid=7fa81f957800 nid=0x109710000 waiting for monitor entry [10970f000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-104" prio=5 tid=7fa81f953800 nid=0x10960d000 waiting for monitor entry [10960c000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-103" prio=5 tid=7fa81f955000 nid=0x10950a000 waiting for monitor entry [109509000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-102" prio=5 tid=7fa81f04f800 nid=0x109407000 waiting for monitor entry [109406000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-101" prio=5 tid=7fa81f954000 nid=0x109304000 waiting for monitor entry [109303000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-100" prio=5 tid=7fa81f16a000 nid=0x109201000 waiting for monitor entry [109200000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-99" prio=5 tid=7fa81f0f7000 nid=0x1090fe000 waiting for monitor entry [1090fd000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-98" prio=5 tid=7fa81f944000 nid=0x109b1c000 waiting for monitor entry [109b1b000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-97" prio=5 tid=7fa81f943000 nid=0x109a19000 waiting for monitor entry [109a18000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:63)
- waiting to lock <7f44e2020> (a java.lang.Integer)
- locked <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-96" prio=5 tid=7fa81f95a800 nid=0x109916000 waiting for monitor entry [109915000]
java.lang.Thread.State: BLOCKED (on object monitor)
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:63)
- waiting to lock <7f44e2050> (a java.lang.Integer)
- locked <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Low Memory Detector" daemon prio=5 tid=7fa81d823800 nid=0x108d1e000 runnable [00000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread1" daemon prio=9 tid=7fa81f885000 nid=0x108c1b000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"C2 CompilerThread0" daemon prio=9 tid=7fa81d823000 nid=0x108b18000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=9 tid=7fa81d822000 nid=0x108a15000 runnable [00000000]
java.lang.Thread.State: RUNNABLE
"Surrogate Locker Thread (Concurrent GC)" daemon prio=5 tid=7fa81d821800 nid=0x108912000 waiting on condition [00000000]
java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=8 tid=7fa81f883000 nid=0x108709000 in Object.wait() [108708000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f44f3ba0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
- locked <7f44f3ba0> (a java.lang.ref.ReferenceQueue$Lock)
at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:171)
"Reference Handler" daemon prio=10 tid=7fa81d812800 nid=0x108606000 in Object.wait() [108605000]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <7f44e68d0> (a java.lang.ref.Reference$Lock)
at java.lang.Object.wait(Object.java:485)
at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
- locked <7f44e68d0> (a java.lang.ref.Reference$Lock)
"VM Thread" prio=9 tid=7fa81f039800 nid=0x108503000 runnable
"Gang worker#0 (Parallel GC Threads)" prio=9 tid=7fa81f800800 nid=0x1049c2000 runnable
"Gang worker#1 (Parallel GC Threads)" prio=9 tid=7fa81f001800 nid=0x104ac5000 runnable
"Gang worker#2 (Parallel GC Threads)" prio=9 tid=7fa81f004800 nid=0x104bc8000 runnable
"Gang worker#3 (Parallel GC Threads)" prio=9 tid=7fa81f801000 nid=0x104ccb000 runnable
"Concurrent Mark-Sweep GC Thread" prio=9 tid=7fa81f86f800 nid=0x108184000 runnable
"VM Periodic Task Thread" prio=10 tid=7fa81f04b000 nid=0x108e21000 waiting on condition
"Exception Catcher Thread" prio=10 tid=7fa81f001000 nid=0x100fcd000 runnable
JNI global references: 1096
Found one Java-level deadlock:
=============================
"Thread-200":
waiting to lock monitor 7fa81b81bf60 (object 7f44e2020, a java.lang.Integer),
which is held by "Thread-96"
"Thread-96":
waiting to lock monitor 7fa81b82d108 (object 7f44e2050, a java.lang.Integer),
which is held by "Thread-97"
"Thread-97":
waiting to lock monitor 7fa81b81bf60 (object 7f44e2020, a java.lang.Integer),
which is held by "Thread-96"
Java stack information for the threads listed above:
===================================================
"Thread-200":
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:62)
- waiting to lock <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-96":
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:63)
- waiting to lock <7f44e2050> (a java.lang.Integer)
- locked <7f44e2020> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
"Thread-97":
at com.lss.test.ThreadLock$SyncLockRunnable.run(ThreadLock.java:63)
- waiting to lock <7f44e2020> (a java.lang.Integer)
- locked <7f44e2050> (a java.lang.Integer)
at java.lang.Thread.run(Thread.java:695)
Found 1 deadlock.
本案例是我在阅读:深入理解Java虚拟机.JVM高级特性和最佳实践 auth:周志明
非常不错的一本关于JVM的书籍推荐。