摘要: interrupt(): 打断 sleep、wait、join 的线程会抛出 InterruptedException 异常并清除打断标记,如果打断正在运行的线程、park 的线程则会重新设置打断标记isInterrupted(): 不会清除打断标记interrupted(): 会清除打断标记 一、 阅读全文
posted @ 2024-01-10 17:28 变体精灵 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 案例代码 @Slf4j public class JoinDemo { public static void main(String[] args) throws InterruptedException { Thread t1 = new Thread(() -> { log.info("{} 线 阅读全文
posted @ 2024-01-10 16:58 变体精灵 阅读(1) 评论(0) 推荐(0) 编辑