The Wayback Machine - https://web.archive.org/web/20201130002938/https://github.com/CyC2018/CS-Notes/issues/574
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java并发 InterruptedException部分一点疑问 #574

Closed
tiaot33 opened this issue Feb 21, 2019 · 1 comment
Closed

java并发 InterruptedException部分一点疑问 #574

tiaot33 opened this issue Feb 21, 2019 · 1 comment
Labels

Comments

@tiaot33
Copy link

@tiaot33 tiaot33 commented Feb 21, 2019

通过调用一个线程的 interrupt() 来中断该线程,如果该线程处于阻塞、限期等待或者无限期等待状态,那么就会抛出 InterruptedException,从而提前结束该线程。但是不能中断 I/O 阻塞和 synchronized 锁阻塞。

既然不能中断syn锁阻塞,那么线程应该是处于限期等待无限期等待状态才会抛异常吧?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.