更新时间:2023-01-11 07:43:22
为了能够调用notify() 你需要在同一个对象上同步.
To be able to call notify() you need to synchronize on the same object.
synchronized (someObject) {
someObject.wait();
}
/* different thread / object */
synchronized (someObject) {
someObject.notify();
}