
Solutions to CP W99 Lab1

NB -- use CW compare file utility to see diffs

CountDown
- make CountDown Runnable
- add a run method that ticks
- start a new thread in the Applet's start() method

Double Rotator
- make RotatorPanel Runnable
- add isRunning flag
- add run() method that rotates while isRunning()
- synchronize isRunning(), setActive() and setInActive()
- NB: notifyAll() in setActive() (optional in setInActive())

Garden
- synchronize increment() in SafeCounter subclass of Counter 
- change Garden.java to use SafeCounter
- NB: we add a subclass rather than modify Counter since
  only the shared counter needs to be synchronized
- NB: call super() instead of duplicating code!

Philosophers
- modify Philosopher to know whether he is even or odd
- modify RunnablePhilosopher to pick up right fork if even,
  else left fork
- NB: to have a fair solution, we need a more sophisticated solution,
 for example, using a queue to sit down and eat.
