这是JDK1.6 API里Condition接口里面多生产者多消费者生产消费多个蛋糕的模型,看了好久没有看懂,应该是没有具体对象,所以比较抽象,毕老师说这个开发时复制完拿来就能用,谁有这个代码的应用实例?
class BoundedBuffer {
final Lock lock = new ReentrantLock();
final Condition notFull = lock.newCondition();
final Condition notEmpty = lock.newCondition();
final Object[] items = new Object[100];
int putptr, takeptr, count;