Wait 썸네일형 리스트형 wait(), notify() wait(), notify() 예제 class Account { String name; int total; public Account(String name) { this.name = name; } // 순서 스레드 접근 영역 : 동기화 영역. synchronized void deposit(int money, String loc) { if(total>7000){ try { System.out.println("최대 잔액 초과"); wait(); // wait 스레드 실행시작 } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } total = 0; notify(); // notify 스레드 실행.. 더보기 이전 1 다음