"system.exit is not thread-safe on linux?" Code Answer


it depends, the runhooks method will start any hook threads registered through runtime.addshutdownhook and wait for them to be finished. if any of your hook threads is locking some resources that the awt event thread is requiring too, they may cause dead lock.

if you have to call system.exit in your awt event thread,i suggest you call it in another thread like:

 new thread(){
            public void run() {
By Manpreet Didwal on October 6 2022
Only authorized users can answer the Search term. Please sign in first, or register a free account.