Workaround for NPE on ExecutorService.shutdownNow()
This commit is contained in:
parent
414e02cb3e
commit
f7e7d8f524
@ -57,7 +57,12 @@ public class ExecutorShutdownUtil {
|
||||
|
||||
ExecutorService es = (ExecutorService) e;
|
||||
for (;;) {
|
||||
try {
|
||||
es.shutdownNow();
|
||||
} catch (NullPointerException ex) {
|
||||
// Some JDK throws NPE here, but shouldn't.
|
||||
}
|
||||
|
||||
try {
|
||||
if (es.awaitTermination(1, TimeUnit.SECONDS)) {
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user