package waitnotify;

/**
 * @author ssb
 */
public class CountdownMaster implements Runnable {

	private volatile boolean shutdown_;

	public CountdownMaster () {
		shutdown_ = false;
	}

	/*
	 * (non-Javadoc)
	 * @see java.lang.Runnable#run()
	 */
	@Override
	public void run () {
		for ( ; !shutdown_ ; ) {
			try {
				Thread.sleep(5000);
			} catch ( InterruptedException e ) { continue; }
			synchronized ( this ) {
				System.out.println("---------------------------------------");
				this.notifyAll();
			}
		}
	}

	public void shutdown () {
		shutdown_ = true;
	}
}
