使用非静态字段的双重检查锁定是否正确?
class Foo
{
private SomeType member;
private readonly object memeberSync = new object();
public SomeType Memeber
{
get
{
if(member == null)
{
lock(memeberSync)
{
if(member == null)
{
member = new SomeType();
}
}
}
return object;
}
}
}