线程中join()的用法
摘要:Thread中,join()方法的作用是调用线程等待该线程完成后,才能继续用下运行。public static void main(String[] args) throws InterruptedException { System.out.println("main start"); Thread t1 = new Thread(new Worker("thread-1")); t1.start(); t1.join(); System.out.println("main end"); }在上面的例子中,ma...
阅读全文
posted @ 2013-08-17 11:10
浙公网安备 33010602011771号