package thread2;

import helper.TextUi;

public class Main {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		TextUi.println("Creating the two threads");
		MyThread2 t1 = new MyThread2("First");
		t1.start();
		MyThread2 t2 = new MyThread2("Second");
		t2.start();
		while (true) {
			int value = TextUi.inputInteger("Input the thread to notify");
			switch (value) {
			case 1:
				synchronized (t1) {
					t1.notify();
				}
				break;
			case 2:
				synchronized (t2) {
					t2.notify();
				}
				break;
			}
		}
	}
}

