retruptedException后的retriables?

问题描述 投票:0回答:1
if(Thread.currentThread().isInterrupted()) { //reset variables here }

或:

if(Thread.interrupted()) { //reset variables here }
有人可以帮我吗?预先感谢您!

您可以将您的整个物品包裹在一个trycatch块中:

try { //Code here } catch (InterruptedException e) { //Reset variables here }
java multithreading exception interrupt
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.