示例#1
0
        public static DiskPersistBasicStore <TValue> GetInstance(string path)
        {
            if (instance == null)
            {
                lock (syncRoot)
                {
                    if (instance == null)
                    {
                        instance = new DiskPersistBasicStore <TValue>(path);
                    }
                }
            }

            return(instance);
        }
示例#2
0
        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);
            }
        }