class Program {
static void Main(string[] args) {
// 使用无参数委托ThreadStart
Thread t = new Thread(wucan);
t.Start();
// 使用带参数委托ParameterizedThreadStart
Thread t2 = new Thread(youcan);
t2.Start("chuanru");
t2.Join();// 等待线程t2完成。
Console.WriteLine("Thread t2 已经执行完成");
Console.ReadKey();
}
static void wucan() {
Console.WriteLine("wucan!");
}
static void GoWithParam(object msg) {
Console.WriteLine("msg:" + msg);
Thread.Sleep(1000);// 模拟耗时操作
}
}