public static void logAndDie(String message, Throwable thrown, boolean dumpThreads) {
        boolean shutDownInProgress = alreadyShuttingDown.getAndSet(true);
        try {
            if (thrown != null) {
                log.log(Level.SEVERE, message, thrown);
            } else {
                log.log(Level.SEVERE, message);
            }
            log.log(Level.INFO, "About to shut down.");
            if (dumpThreads) {
                dumpThreads();
            }
        } finally {
            if ( ! shutDownInProgress ) {
                try {
                    Runtime.getRuntime().halt(1);
                } catch (Throwable t) {
                    log.log(Level.SEVERE, "Runtime.halt rejected. Throwing an error.");
                    throw new ShutdownError("Shutdown requested, but failed to shut down");
                }
            } else {
                log.log(Level.WARNING, "Shutdown already in progress. Will just let death come upon us normally.");
            }
        }
    }
Log message as severe error, then forcibly exit runtime, without running
exit handlers or otherwise waiting for cleanup.

@param message message to log before exit
@param thrown the throwable that caused the application to exit.
@param dumpThreads if true the stack trace of all threads is dumped to the
                  log with level info before shutting down
vespajlib/src/main/java/com/yahoo/protect/Process.java