Thread.join疑惑
这段代码的结果将是如何?
static void Main()
{
Test t = new Test();
t.ThreadList();
}
public void ThreadList()
{
Work w1 = new Work();
Thread Thread1 = new Thread(new ThreadStart(w1.DoWork1));
Thread Thread2 = new Thread(new ThreadStart(w1.DoWork2));
Thread Thread3 = new Thread(new ThreadStart(w1.DoWork3));
List<Thread> thdlst = new List<Thread>();
thdlst.Add(Thread1);
thdlst.Add(Thread2);
thdlst.Add(Thread3);
foreach (Thread thd in thdlst)
{
thd.Start();
}
foreach (Thread thd in thdlst)
{
thd.Join();
}
}