interrupt不是结束线程,是改变线程的状态。
比如原来一个线程在wait,那么interrupt可以告诉他:“好了,该干啥干啥去吧,别整天吃饱了没事干就在那里wait啦”
比如原来一个线程在wait,那么interrupt可以告诉他:“好了,该干啥干啥去吧,别整天吃饱了没事干就在那里wait啦”
解决方案 »
- 如何画一个坐标轴?
- JAVA编程思想第4版的习题答案
- 关于windowClosing()按扭关闭的问题
- 求助 连接oracle成功之后如何操作?
- 是不是java.exe一次,就有了产生一个jvm?
- 简单讲解用JMF技术在网页中用Applet直接抓取摄像头的影像的问题???
- [求助] 如何影响父类的流程但不重写它?
- java 中的e符号
- centos下eclipse ALT键不能使用
- 刚刚接触java,跟着书看的,有点小迷惑,求大神简化讲解!
- !!!jbuilder开发servlet时出现的有趣问题?不知道怎么解决!!!!!!!!!!!!!
- !!!关于控制台下字符串怎么输出才会有规定的格式??!!!!!!!
Interrupts this thread.
First the checkAccess method of this thread is invoked, which may cause a SecurityException to be thrown. If this thread is blocked in an invocation of the wait(), wait(long), or wait(long, int) methods of the Object class, or of the join(), join(long), join(long, int), sleep(long), or sleep(long, int), methods of this class, then its interrupt status will be cleared and it will receive an InterruptedException. If this thread is blocked in an I/O operation upon an interruptible channel then the channel will be closed, the thread's interrupt status will be set, and the thread will receive a ClosedByInterruptException. If this thread is blocked in a Selector then the thread's interrupt status will be set and it will return immediately from the selection operation, possibly with a non-zero value, just as if the selector's wakeup method were invoked. If none of the previous conditions hold then this thread's interrupt status will be set.