Esempio n. 1
0
 public void stop() {
   running = false;
   try {
     thread.join();
   } catch (InterruptedException ex) {
   }
   System.out.println("Philosopher # " + getID() + " stopped.");
   thread = null;
 }
Esempio n. 2
0
 public void go() {
   System.out.println("Time to go...");
   running = true;
   thread = new Thread(this);
   thread.start();
 }