110,539
社区成员
发帖
与我相关
我的任务
分享
public class TestClass
{
public int Column1 { set; get; }
public int Column2 { set; get; }
//private object obj = new object();
object lockindex = 0;
public void TestMethodA(int i)
{
lock (lockindex)
{
while (true)
{
Console.WriteLine(Thread.CurrentThread.Name +":"+ lockindex.GetType());
Thread.Sleep(10); }
//Console.WriteLine(Column1);
}
}
public void TestMethodB()
{
Console.WriteLine("B_Start");
Console.WriteLine("B_End");
}
}