在MSDN文档说,
public class SomeObject
{
public void SomeOperation()
{
lock(this)
{
//Access instance variables
}
}
}
Run Code Online (Sandbox Code Playgroud)
如果可以公开访问实例,那就是"一个问题".我想知道为什么?是因为锁定的持有时间超过了必要的时间吗?还是有一些更阴险的原因?
需要:
通缉:
背景:
重点: