static Thread StartThread() { Thread th = new Thread(execute); th.Name = "Thread #" + ThreadCounter.Add(); th.Start(code); return(th); }
public void TestThreading() { for (int i = 0; i < 15; i++) { StartThread(); } ThreadCounter.Wait(); }
static void execute(object code) { string codestring = (string)code; object rez = Script.RunCode(codestring); Assert.AreEqual(255, rez); ThreadCounter.Dec(); }