import java.util.concurrent.locks.*;
class ThreadDemo5{
public static void main(String[] args)
{
Resource r=new Resource();
Producer p=new Producer(r);
Customer c=new Customer(r);
new Thread(p,"生产者NO.1").start();
new Thread(p,"生产者NO.2").start();
new Thread(c,"消费者NO.1").start();
new Thread(c,"消费者NO.2").start();
}
}