zhangjie
Results
1
issues of
zhangjie
原文是使用reentrantLock和condition来实现多生产,多消费模式,但是再开启多个线程的时候传入的是同一个condition,并不能控制多个线程 ``` public static void main(String[] args) throws InterruptedException { ReentrantLock lock = new ReentrantLock(); Condition newCondition = lock.newCondition(); Product product = new Product(lock,newCondition); Consumer consumer = new Consumer(lock,newCondition); for(int...