class Fork { boolean taken; synchronized void drop (Philo p) { taken = false; notify (); } synchronized void take (Philo p) { while (taken) { wait (); } taken = true; } }