Skip to content

interrupted方法描述有误 #3

@Luolanjiao

Description

@Luolanjiao

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions