Join() Demonstration
Demonstrates the effect
of the Java join() primitive. The Master thread rotates until its segment changes
colour and then creates and starts the Slave thread. The Master continues rotating
until the segment changes colour again at which point it joins the Slave thread.
When started, the Slave rotates until it terminates. The amount of rotation
by the Slave is returned as a result to the Master and displayed. The slave
rotation and the time between the master starting and joining the slave can
be controlled by the slider controls. To see the Master blocked waiting for
the Slave to terminate, move both sliders to the left.
JoinDemo.java