JavaTutorial icon indicating copy to clipboard operation
JavaTutorial copied to clipboard

interrupted方法描述有误

Open Luolanjiao opened this issue 5 years ago • 1 comments

image 你好,这句话有误了,根据interrupted方法的注释,应该是:如果连续两次调用interrupted(),第一次如果是true,第二次一定是false.因为此方法只会清除被中断的状态,而不会主动设置中断状态。

  • Tests whether the current thread has been interrupted. The
    • interrupted status of the thread is cleared by this method. In
    • other words, if this method were to be called twice in succession, the
    • second call would return false (unless the current thread were
    • interrupted again, after the first call had cleared its interrupted
    • status and before the second call had examined it).

Luolanjiao avatar May 06 '19 06:05 Luolanjiao

不过还是非常感谢提供的资源,教程非常详细,很受用,^_^

Luolanjiao avatar May 06 '19 06:05 Luolanjiao