Exemplo n.º 1
0
  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();
    }
  }
Exemplo n.º 2
0
  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;
  }