Tag Archives: thread

有关Runtime.addShutdownHook(Thread)

今天在JDK的javadoc里瞎转的时候无意间发现这么一个有趣的回调方法: addShutdownHook public void <b>addShutdownHook</b>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://download.oracle.com']);" title="class in java.lang">Thread</a> hook) public void <b>addShutdownHook</b>(<a href=”http://download.oracle.com/javase/6/docs/api/java/lang/Thread.html” onclick=”javascript:_gaq.push(['_trackEvent','outbound-article','http://download.oracle.com']);” title=”class in java.lang”>Thread</a> hook) Registers a new virtual-machine shutdown hook. The Java virtual machine shuts down in response to two kinds of events: The program exits normally, when the last non-daemon thread exits or when the exit (equivalently, System.exit) read more »

无觅相关文章插件,快速提升流量