You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ java -cp target/classes/:target/graal-test-0.0.1-SNAPSHOT.jar Threads
Still here 0
Still here 1
Still here 2
Still here 3
^CClosing
java.lang.RuntimeException: probe
at Threads$1.run(Threads.java:34)
The shutdown hook is run after the end of all the other threads. When you compile to a native image the shutdown hook gets run out of order (first, it seems, before any other threads):
$ ./threads
Closing
java.lang.RuntimeException: probe
at java.lang.Throwable.<init>(Throwable.java:265)
at java.lang.Exception.<init>(Exception.java:66)
at java.lang.RuntimeException.<init>(RuntimeException.java:62)
at Threads$1.run(Threads.java:34)
at com.oracle.svm.core.jdk.Util_java_lang_ApplicationShutdownHooks.callRunnableOfThread(JavaLangSubstitutions.java:656)
at com.oracle.svm.core.jdk.Target_java_lang_ApplicationShutdownHooks.runHooks(JavaLangSubstitutions.java:576)
at com.oracle.svm.core.jdk.Util_java_lang_ApplicationShutdownHooks$1.run(JavaLangSubstitutions.java:637)
at java.lang.Shutdown.runHooks(Shutdown.java:123)
at java.lang.Shutdown.sequence(Shutdown.java:167)
at java.lang.Shutdown.shutdown(Shutdown.java:234)
at com.oracle.svm.core.jdk.RuntimeSupport.shutdown(RuntimeSupport.java:183)
at com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:179)
Still here 0
Still here 1
Still here 2
Still here 3
This obviously causes problems for programs that actually clean up resources in a shutdown hook.
The text was updated successfully, but these errors were encountered:
This code:
runs fine with the normal JDK:
The shutdown hook is run after the end of all the other threads. When you compile to a native image the shutdown hook gets run out of order (first, it seems, before any other threads):
This obviously causes problems for programs that actually clean up resources in a shutdown hook.
The text was updated successfully, but these errors were encountered: