public static void MoreThreadsArgTest() { Console.WriteLine("\t<<< Class \"MoreThreadsArgTest\" Test >>>"); MyThreadImproved mt = new MyThreadImproved("Thread #1", 5); MyThreadImproved mt2 = new MyThreadImproved("Thread #2", 10); do { Thread.Sleep(100); } while (mt.Thread.IsAlive || mt2.Thread.IsAlive); Console.WriteLine("\t\\\\ Class \"MoreThreadsArgTest\" Test //\n"); }
public static void MoreThreadsJoinTest() { Console.WriteLine("\t<<< Class \"MoreThreadsJoinTest\" Test >>>"); MyThreadImproved mt1 = new MyThreadImproved("Thread #1"); MyThreadImproved mt2 = new MyThreadImproved("Thread #2"); MyThreadImproved mt3 = new MyThreadImproved("Thread #3"); mt1.Thread.Join(); Console.WriteLine(mt1.Thread.Name + " joined"); Console.WriteLine(mt2.Thread.Name + " joined"); Console.WriteLine(mt3.Thread.Name + " joined"); Console.WriteLine("\t\\\\ Class \"MoreThreadsJoinTest\" Test //\n"); }
public static void MoreThreadsTest() { Console.WriteLine("\t<<< Class \"MoreThreadTest\" Test >>>"); MyThreadImproved mt1 = new MyThreadImproved("Thread #1"); MyThreadImproved mt2 = new MyThreadImproved("Thread #2"); MyThreadImproved mt3 = new MyThreadImproved("Thread #3"); do { Console.Write("."); Thread.Sleep(100); } while ( mt1.Thread.IsAlive && mt2.Thread.IsAlive && mt3.Thread.IsAlive ); Console.WriteLine("\t\\\\ Class \"MoreThreadTest\" Test //\n"); }