01 2024 档案
摘要:interrupt(): 打断 sleep、wait、join 的线程会抛出 InterruptedException 异常并清除打断标记,如果打断正在运行的线程、park 的线程则会重新设置打断标记isInterrupted(): 不会清除打断标记interrupted(): 会清除打断标记 一、
阅读全文
摘要:案例代码 @Slf4j public class JoinDemo { public static void main(String[] args) throws InterruptedException { Thread t1 = new Thread(() -> { log.info("{} 线
阅读全文