头疼程序员 2022-07-22 23:32 采纳率: 90%
浏览 10
已结题

join()方法的wait为什么会使调用者wait

public final synchronized void join(long millis)throws InterruptedException 
if (millis == 0) {
    while (isAlive()) {
        wait(0);
}
//在main里面调用thread.join(),isAlive判断thread是否存货我能理解,可接下来的wait为什么是让main等待了
  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 7月30日
    • 创建了问题 7月22日