优化 ThreadUtils.sleep 增加 currentThread().interrupt();
This commit is contained in:
@@ -21,7 +21,7 @@ public class ThreadUtils {
|
|||||||
try {
|
try {
|
||||||
Thread.sleep(millis);
|
Thread.sleep(millis);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// Ignore.
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ public class ThreadUtils {
|
|||||||
try {
|
try {
|
||||||
Thread.sleep(unit.toMillis(duration));
|
Thread.sleep(unit.toMillis(duration));
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// Ignore.
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user