每个线程都有一个与之相关联的 Bool ean 属性, 用于表示线程的中断状态(interrupted status) 。 中断状态初始时为 fal se; 当另一个线程通过调用 Thread.
基于12个网页-相关网页
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时,它清除中断状态。
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() 中断一个线程时,会出现以下两种情况之一。
应用推荐