简体   繁体   English

如何知道Java中InterruptedException的原因

[英]How to know the cause of InterruptedException in Java

如何知道中断A的线程A抛出了InterruptedException

No, you could not know which thread triggers the interrupt. 不,您不知道哪个线程触发了中断。

It is kind of status flag, that's it. 这是一种状态标志,仅此而已。 No matter InterruptedException or isInterrupted() , there is no extra information provided. 无论InterruptedException还是isInterrupted() ,都不会提供额外的信息。

Further, if you need to cooperate threads in finer grade, try other ways. 此外,如果您需要在更高等级上配合螺纹,请尝试其他方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM