The interrupted status of the current thread is cleared when this exception is thrown.
在抛出此异常时,当前线程的中断状态被清除。
If the task needs to be more responsive, it can poll the interrupted status more frequently.
如果任务需要提高响应能力,那么它可以更频繁地轮询中断状态。
When a blocking method detects interruption and throws InterruptedException, it clears the interrupted status.
当一个阻塞方法检测到中断并抛出InterruptedException时,它清除中断状态。
To be a good citizen, it restores the interrupted status in a finally block after it is finished, so as not to deprive callers of the interruption request.
为了方便他人,它在结束后在一个finally块中恢复中断状态,以免剥夺中断请求的调用者的权利。
The interrupted status is initially false; when a thread is interrupted by some other thread through a call to Thread.interrupt(), one of two things happens.
中断状态初始时为 false;当另一个线程通过调用 Thread.interrupt() 中断一个线程时,会出现以下两种情况之一。
Methods that do not block but that still may take a long time to execute can respect requests for interruption by polling the interrupted status and return early if interrupted.
对于中断请求,不阻塞但是仍然要花较长时间执行的方法可以轮询中断状态,并在被中断的时候提前返回。
However, even noncancelable tasks should attempt to preserve the interrupted status in case code higher up on the call stack wants to act on the interruption after the noncancelable task completes.
但是,即使是不可取消的任务也应该尝试保留中断状态,以防在不可取消的任务结束之后,调用栈上更高层的代码需要对中断进行处理。
I gave my son a task, and he (repeatedly) interrupted me with the status.
我给我儿子一个任务,他(重复的)打断我,告诉我他的状态。
Conclusions the endemic rebound in regions after the transmission under control or interrupted is caused by biological, natural and social factors and mainly presents as the rebound of snail status.
结论受生物、自然、社会等诸多因素的影响,传控和传阻达标地区疫情回升主要表现为螺情回升。
Conclusions the endemic rebound in regions after the transmission under control or interrupted is caused by biological, natural and social factors and mainly presents as the rebound of snail status.
结论受生物、自然、社会等诸多因素的影响,传控和传阻达标地区疫情回升主要表现为螺情回升。
应用推荐