public void listenController() throws InterruptedException { director.getDirectorLock().lock(); try { if (controller.isFlag_of_entrance() == true) System.out.println("Турникет EAST открыт(Контроллер)"); else System.out.println("Турникет EAST закрыт(Контроллер)"); } finally { director.getDirectorLock().unlock(); } }
public boolean permitPeople() throws InterruptedException { // ������� ����������� ���� ������ ���� director.getDirectorLock().lock(); try { if (controller.isFlag_of_entrance() == true) // ���� ���������� ��������� ��� ����� { entrance = true; return true; } } finally { director.getDirectorLock().unlock(); } entrance = false; return false; }