Skip to content

Commit

Permalink
Shutdown hook has to linger until application terminates
Browse files Browse the repository at this point in the history
  • Loading branch information
dmlloyd committed Nov 26, 2018
1 parent 86288ab commit b6d5eca
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public ShutdownHookThread(final AtomicBoolean shutdownFlag, Thread mainThread) {
public void run() {
shutdownFlag.set(true);
LockSupport.unpark(mainThread);
for (;;) try {
mainThread.join();
return;
} catch (InterruptedException ignored) {
}
}

public String toString() {
Expand Down

0 comments on commit b6d5eca

Please sign in to comment.