// Simple test program for Java threads and condition variables // George F. Riley, ECE3055, Spring 2003 import Philosopher; class Testjt0 { private static Object m = new Object(); private static Object c = new Object(); public static void main(String args[]) { for (int i = 0; i < 5; ++i) { // Create the thread Philosopher p = new Philosopher(i, c, m); // Start the thread running p.start(); } // Wait for all done condition synchronized(c) { try { c.wait(); } catch (Exception e) {} } System.out.println("Main got all-done signal"); } }