"system.exit is not thread-safe on linux?" Code Answer
4
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() {
system.exit(0);
}
}.start();
it depends, the
runhooks
method will start any hook threads registered throughruntime.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: