private static WorkFlow instance = null;
private static readonly object syncObj = new object();
/// <summary>
/// 创建实力
/// </summary>
public static WorkFlow Instance
{
get
{
if (instance == null)
{
lock (syncObj)
{
if (instance == null)
{
instance = new WorkFlow();
}
}
}
return instance;
}
}
C# 创建单例
原文:http://www.cnblogs.com/dullbaby/p/4334251.html