Java SE/Producer & Consumer 01 썸네일형 리스트형 Producer & Consumer Dead-lock example class Store { public int bread; // 생산자, 소비자가 공유할 데이터 public static void main(String[] args) { Store store = new Store(); new Producer(store).start(); new Consumer(store).start(); } } class Producer extends Thread { Store store; Producer(Store store){ this.store = store; } public void run() { while(true) { synchronized(store) { if(store.bread 더보기 이전 1 다음