1:通过jstack得到线程堆栈信息;
2:
redission-netty-2-96 #4052 prio=5 os_prio=0 tid=0x00007fea000b6000 nid=0xff5 runnable
java.lang.Thread.State:RUNNABLE
at sun.nio.ch.EPollArrayWrapper.epollWait(Native Method)
.......
at sun.nio.ch.SelectorImpl.lockAndDoSelect(SelectorImpl.java:86)
-locked <0x000000002f7a45b08> (a io.netty.channel.nio,SelectedSelectionKeyKey)
...........
3: 查看SelectorImpl源码
private int lockAndDoSelect(long var1) throws IOException {
synchronized(this) {
if (!this.isOpen()) {
throw new ClosedSelectorException();
} else {
int var10000;
synchronized(this.publicKeys) {
synchronized(this.publicSelectedKeys) {
var10000 = this.doSelect(var1);
}
}
return var10000;
}
}
}
问题就在于lock问题;