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