我想打电话Thread.sleep,并传播InterruptException它确实它被扔了.
想象的语法:
Interruptibles.sleep(1000);
Run Code Online (Sandbox Code Playgroud)
这相当于
try {
Thread.sleep(1000);
} catch (InterruptException e) {
throw Throwables.propagate(e);
}
Run Code Online (Sandbox Code Playgroud)
在公共库(番石榴,apache公共等)中是否有类似的功能.
| 归档时间: |
|
| 查看次数: |
1316 次 |
| 最近记录: |