• If the task needs to be more responsive, it can poll the interrupted status more frequently.

    如果任务需要提高响应能力,那么它可以更频繁地轮询中断状态。

    youdao

  • When a blocking method detects interruption and throws InterruptedException, it clears the interrupted status.

    当一个阻塞方法检测到中断并抛出InterruptedException时,它清除中断状态。

    youdao

  • 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() 中断一个线程时,会出现以下两种情况之一。

    youdao

  • 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.

    对于中断请求,不阻塞但是仍然要花较长时间执行的方法可以轮询中断状态,并在被中断的时候提前返回。

    youdao

  • 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.

    但是,即使是不可取消的任务也应该尝试保留中断状态,以防在不可取消的任务结束之后,调用栈上更高层的代码需要对中断进行处理。

    youdao

  • The interrupted status of the current thread is cleared when this exception is thrown.

    在抛出此异常时,当前线程的中断状态被清除。

    youdao

  • The interrupted status of the current thread is cleared when this exception is thrown.

    在抛出此异常时,当前线程的中断状态被清除。

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定