Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设以下方法已正确同步并从对象 B 上的线程 A 调用:
等待(2000);
调用此方法后,线程 A 何时会成为 CPU 下一轮的候选者?
wait(2000) 释放 B 上的锁,并使线程 A 进入等待状态。这意味着它必须等待另一个线程“b”完成其执行至少 2 秒,否则它将进入可运行状态,但不会运行