Skip to content

Commit

Permalink
Merge pull request #146 from dmlloyd/sd-linger
Browse files Browse the repository at this point in the history
Shutdown hook has to linger until application terminates
  • Loading branch information
stuartwdouglas authored Nov 27, 2018
2 parents ab82578 + b6d5eca commit dd5e811
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 dd5e811

Please sign in to comment.