在这段代码中,两个joins和break是什么意思?t1.join()
导致t2
停止,直到t1
终止?
Thread t1 = new Thread(new EventThread("e1"));
t1.start();
Thread t2 = new Thread(new EventThread("e2"));
t2.start();
while (true) {
try {
t1.join();
t2.join();
break;
} catch (InterruptedException e) {
e.printStackTrace();
}
}
https://stackoverflow.com/questions/15956231
复制相似问题