【发布时间】:2015-05-25 17:57:30
【问题描述】:
System.Threading.Thread thd1 = new System.Threading.Thread(new System.Threading.ThreadStart(DoWork));
thd1.Start();
System.Threading.Thread thd2 = new System.Threading.Thread(new System.Threading.ThreadStart(DoWork));
thd2.Start();
thd1.Join();
thd2.Join();
我只是想知道为什么人们使用Thread.Join() ?
Thread.Join() 阻止下一行执行并等待特定线程完成。当该特定线程完成时,下一行将被执行。
用正确的例子告诉我Thread.Join() 的意图。谢谢
【问题讨论】:
标签: c# multithreading