From b6d5eca3115cf7059620d149185e359d3be851b3 Mon Sep 17 00:00:00 2001 From: "David M. Lloyd" Date: Mon, 26 Nov 2018 12:46:35 -0600 Subject: [PATCH] Shutdown hook has to linger until application terminates --- .../org/jboss/shamrock/runtime/graal/ShutdownHookThread.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/runtime/src/main/java/org/jboss/shamrock/runtime/graal/ShutdownHookThread.java b/core/runtime/src/main/java/org/jboss/shamrock/runtime/graal/ShutdownHookThread.java index 0d9a7cd944475..c153af81a4139 100644 --- a/core/runtime/src/main/java/org/jboss/shamrock/runtime/graal/ShutdownHookThread.java +++ b/core/runtime/src/main/java/org/jboss/shamrock/runtime/graal/ShutdownHookThread.java @@ -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() {