首页 > TAG信息列表 > SynchroThis

避免lock(this)容易发生死锁

避免lock(this) lock(this)容易发生死锁 应该对私有引用变量加锁 下面是发生死锁示例 program.cs // See https://aka.ms/new-console-template for more information using DeadLock; Console.WriteLine("Hello, World!"); SynchroThis st = new SynchroThis(); Monitor.Enter