????????????C#?н??Thread??????о??????????Thread.Join()???????????????????????
????Thread.Join()??MSDN?е??????????Blocks the calling thread until a thread terminates
?????????????????
   1.????the calling thread?
????2.????a thread?
????????????????й????? ??????????.exe??????????????????????????????????????????
????????????????????????????Team?кü?????????????????????????Team.
???????嵽???????????Console Application?????????Test.exe??Main??????????У????????????????
?????????Main?????????????MainThread.??????????Main???????????????Thread??????NewThread???????????
????NewThread.Start()?????????? MainThread?????Main?????????????????NewThread.Start()??????????NewThread.
?????????????????????????ó?????????????????????the calling thread??MainThread????a thread???????MainThread?????NewThread????
??????????MSDN??????????????????????NewThread????Join?????????MainThread??????У????NewThread??????????????????????O(∩_∩)O????~
???????????????????????????????????????
Title
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace Test
{
class TestThread
{
private static void ThreadFuncOne()
{
for (int i = 0; i < 10; i++)
{
Console.WriteLine(Thread.CurrentThread.Name +"   i =  " + i);
}
Console.WriteLine(Thread.CurrentThread.Name + " has finished");
}
static void Main(string[] args)
{
Thread.CurrentThread.Name = "MainThread";
Thread newThread = new Thread(new ThreadStart(TestThread.ThreadFuncOne));
newThread.Name = "NewThread";
for (int j = 0; j < 20; j++)
{
if (j == 10)
{
newThread.Start();
newThread.Join();
}
else
{
Console.WriteLine(Thread.CurrentThread.Name + "   j =  " + j);
}
}
Console.Read();
}
}
}
??????????????????
????????????????????????????????MainThread??NewThread.Join?????ú??????????NewThread
????????????????С?