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.
但是,即使是不可取消的任务也应该尝试保留中断状态,以防在不可取消的任务结束之后,调用栈上更高层的代码需要对中断进行处理。
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.
对于中断请求,不阻塞但是仍然要花较长时间执行的方法可以轮询中断状态,并在被中断的时候提前返回。
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块中恢复中断状态,以免剥夺中断请求的调用者的权利。
When a blocking method detects interruption and throws InterruptedException, it clears the interrupted status.
当一个阻塞方法检测到中断并抛出InterruptedException时,它清除中断状态。
Shortly thereafter, that stale, static status message on the MobileMe site was expanded to include this: "We understand this is a serious issue and apologize for this service interruption."
不久之后,老套的官方发言信息出现在MobileMe网站上,增加了以下内容:“我们认识到这是一个严重的问题,并为服务中断向大家致歉。”
Unfortunately, highway traffic jam and traffic interruption and traffic delay, which caused by disaster weather, bad traffic status and traffic events, are becoming more and more serious.
但因灾害性天气、不良交通状况和交通事件等引发公路交通拥挤、交通中断和交通延误以及伤亡惨重的交通事故也随着路网里程的增多而增加。
Unfortunately, highway traffic jam and traffic interruption and traffic delay, which caused by disaster weather, bad traffic status and traffic events, are becoming more and more serious.
但因灾害性天气、不良交通状况和交通事件等引发公路交通拥挤、交通中断和交通延误以及伤亡惨重的交通事故也随着路网里程的增多而增加。
应用推荐