tangxu
2024-04-30 26d8996e55c33186800031f7c305688035bb3182
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using Microsoft.Extensions.Caching.Memory;
using System;
using System.Collections.Concurrent;
 
namespace IStation.ChEr
{
    /// <summary>
    /// 待编写
    /// </summary>
    internal sealed partial class SharedMemoryCache : IMemoryCacheDirect
    {
        /// <summary>
        /// 单例模式(延迟加载)
        /// </summary>
        private static readonly Lazy<SharedMemoryCache> _lazy = new Lazy<SharedMemoryCache>(() => new SharedMemoryCache());
 
        /// <summary>
        /// MemoryCache 实例
        /// </summary>
        private MemoryCache _memoryCache;
 
        /// <summary>
        /// 当前正在设置缓存项的缓存键集合
        /// Collection of all cache keys currently executing a function to set a cache item
        /// </summary>
        private ConcurrentDictionary<string, CacheKeyBeingHandled> _cacheKeysBeingHandled;
 
        /// <summary>
        /// Locker object
        /// </summary>
        private object _wipeLock = new object();
 
        /// <summary>
        /// 标识Wipe方法是否正在执行
        /// State flag indicating whether the wipe method is currently being executed
        /// </summary>
        private bool _isWiping = false;
 
        /// <summary>
        /// Locker object, used to lock set operations when a wipe is in progress
        /// </summary>
        private object _setLock = new object();
 
        /// <summary>
        /// State flag indicating whether any non-waitable set action is currently being executed
        /// </summary>
        private bool _isSetting = false;
 
 
 
    }
 
}