< prev index next >

src/java.base/share/classes/java/lang/ApplicationShutdownHooks.java

Print this page
rev 14883 : 8154017: Shutdown hooks are racing against shutdown sequence, if System.exit()-calling thread is interrupted
Reviewed-by:

*** 100,110 **** for (Thread hook : threads) { hook.start(); } for (Thread hook : threads) { try { hook.join(); ! } catch (InterruptedException x) { } } } } --- 100,114 ---- for (Thread hook : threads) { hook.start(); } for (Thread hook : threads) { + while (true) { try { hook.join(); ! break; ! } catch (InterruptedException ignored) { ! } ! } } } }
< prev index next >