public static DiskPersistBasicStore <TValue> GetInstance(string path) { if (instance == null) { lock (syncRoot) { if (instance == null) { instance = new DiskPersistBasicStore <TValue>(path); } } } return(instance); }
public DiskPersistBasicStore <TValue> GetDiskPersistBasicStore(string path) { if (dict.ContainsKey(path)) { return(GetValue(path)); } object syncRoot = new Object(); lock (syncRoot) { if (dict.ContainsKey(path)) { return(GetValue(path)); } DiskPersistBasicStore <TValue> nDiskStore = new DiskPersistBasicStore <TValue>(path); //DiskPersistBasicStoreManagerWorker<TValue>.GetInstance(path); dict.TryAdd(path, nDiskStore); return(nDiskStore); } }