1.wait方法
根据注释:
it places the current thread * into the wait set for this object
进入wait set
2.notify方法
Wakes up a single thread that is waiting on this object's * monitor. If any threads are waiting on this object, one of them * is chosen to be awakened. The choice is arbitrary and occurs at * the discretion of the implementation. A thread waits on an object's * monitor by calling one of the {@code wait} methods.
从wait set中取出一个线程,可以重新竞争锁
3.notifyall方法
唤醒所有wait set中的线程
wakes up all threads that are waiting on this object's monitor