func1(){if(){func2(){}}}如何保证某个线程在运行func2时其他线程时处于等待状态
在func2()里面写Object lockobj = new Object();void func2(){lock(lockobj){代码逻辑}}