BlockingQueue (1) 썸네일형 리스트형 아이템 81: 동시성 유틸리티를 애용하라 wait와 notify public class Main { public synchronized void waitMehod() throws InterruptedException { System.out.println(Thread.currentThread().getId() + " wait"); wait(); System.out.println(Thread.currentThread().getId() + " notified"); } public synchronized void notifyMethod() throws InterruptedException { System.out.println(Thread.currentThread().getId() + " notify all"); notifyAll(); } public .. 이전 1 다음