(一)Java中线程协作的最常见的两种方式: (1)利用Object的wait().notify()和notifyAll()方法及synchronized (2)使用Condition.ReentrantLock (二)Object类的wait().notify()和notifyAll()方法 /** * Wakes up a single thread that is waiting on this object's * monitor. If any threads are waiting…