Skip to content

4.3.4 线程中断 建议修改 #139

@what2eat2night

Description

@what2eat2night

章节
请描述详细的章节
Screenshot 2023-04-08 at 11 09 31

相关截图或文字
请描述相关的截图或文字
Screenshot 2023-04-08 at 11 08 54

修正意见
请描述修正意见,如果可以,请直接提PR,谢谢~

通过 Thread 静态方法interrupted() 来获取当前线程是否被中断,这个方法会在使用的时候清除中断标志位,
通过thread实例调用 isInterrupted 并不会 清除中断标志位,
建议附上源代码,书中连续两次调用 这样的说法会让人感觉非常疑惑

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions