会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Chenyi_li
博客园
首页
新随笔
联系
订阅
管理
2023年6月5日
interrupt()
摘要: 在Java中,interrupt()方法可以用来中断线程。当一个线程调用interrupt()方法时,该线程的中断标志位会被设置为true,表示该线程被中断了。如果线程正在执行wait()、sleep()或join()方法时,会抛出InterruptedException异常,并且中断标志位会被清除
阅读全文
posted @ 2023-06-05 10:02 Chenyi_li
阅读(8)
评论(0)
推荐(0)
公告