I am trying to understand when a shutdown hook executes. Is it before or after any part of my application has been stopped? Since my shutdown hook code will be running in a freshly created thread, can I access other non-shutdown-hook threads from it? Or they might be stopped/killed by the exiting JVM?
Of course I am assuming the the JVM is exiting due to an exception and not due to a unrecoverable crash which would not execute the shutdown hooks anyways.