public static void PrintNumbers() { var monitor = new SynchronizeThreadsMonitor(); var t1 = new OddThread(monitor); var t2 = new EvenThread(monitor); t1.Start(); t2.Start(); t1.Join(); t2.Join(); }
public EvenThread(SynchronizeThreadsMonitor monitor) { this.monitor = monitor; thread = new Thread(new ThreadStart(this.Run)); }