摘要: 在Java中,interrupt()方法可以用来中断线程。当一个线程调用interrupt()方法时,该线程的中断标志位会被设置为true,表示该线程被中断了。如果线程正在执行wait()、sleep()或join()方法时,会抛出InterruptedException异常,并且中断标志位会被清除 阅读全文
posted @ 2023-06-05 10:02 Chenyi_li 阅读(8) 评论(0) 推荐(0)