c# 线程问题
List<int> ii = new List<int>();
object thislock = new object();
lock (thislock)
{
for (int i = 0; i < 10; i++)
{
Thread td = new Thread(delegate()
{
Console.WriteLine(i);
});
td.Start();
}
}
/* 执行结果
2
3
3
4
5
6
7
7
8
而不是想要的 0,1,2,3,4,5,6,7,8,9*/
...全文



