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() {