public void run() { try { while (!Thread.interrupted()) { // A new customer arrives; assign a WaitPerson: WaitPerson wp = waitPersons.get(rand.nextInt(waitPersons.size())); Customer c = new Customer(wp); exec.execute(c); TimeUnit.MILLISECONDS.sleep(100); } } catch (InterruptedException e) { print("Restaurant interrupted"); } print("Restaurant closing"); }