BLOCKED状态无法被中断吗
来源:7-5 wait解析

qq_期待_fjAHQT
2020-05-29
处于BLOCKED状态的线程即便调用了interrupt方法,该线程依然处于BLOCKED状态 。
老师,这个是这样的吗
写回答
1回答
-
synchronized不抛出中断异常,线程状态不变,但是中断是有效的,如果下次去检查中断状态,可以查到。参考:
https://stackoverflow.com/questions/1820118/interrupting-a-thread-that-waits-on-a-blocking-action
https://www.informit.com/articles/article.aspx?p=31682&seqNum=8
00
相似问题