By javathreads
via java2jee.blogspot.com
Published: Feb 02 2009 / 14:45
Quite recently I was implementing some very small command line tool in Java. In order to clean and release all resources in case user presses Ctrl+C I added shutdown hooks. Unfortunately by mistake I added:
System.exit(0);
line within the shutdown hook and my application couldn't close. When I used jps and jstack I saw a deadlock on exit() method? WTF - I thought - I assumed that this method tries to forcibly close the JVM. You now know what was the problem?
Tweet
SaveShareSend
Tags: java, methodology, open source, reviews
Add your comment
Voters For This Link (14)
-
javathreads -
pbielicki -
java2jee.blogspot.com -
mswatcher -
puredanger -
smies -
mrjohnson -
coop_me -
PeS17 -
wang -
webmascon -
ikysil -
ro -
davneter


