2 instantiations of Stats
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
60
_accumulatedStats = new
Stats
();
61
_stats = new ThreadLocal<Stats>(() => new
Stats
(this));
12 references to Stats
Microsoft.Extensions.Caching.Memory (12)
MemoryCache.cs (12)
28
private readonly List<WeakReference<
Stats
>>? _allStats;
29
private readonly
Stats
? _accumulatedStats;
30
private readonly ThreadLocal<
Stats
>? _stats;
59
_allStats = new List<WeakReference<
Stats
>>();
61
_stats = new ThreadLocal<
Stats
>(() => new Stats(this));
361
foreach (WeakReference<
Stats
> wr in _allStats)
363
if (wr.TryGetTarget(out
Stats
? stats))
374
private
Stats
GetStats() => _stats!.Value!;
393
private void RemoveFromStats(
Stats
current)
399
if (!_allStats[i].TryGetTarget(out
Stats
? stats))
412
private void AddToStats(
Stats
current)
416
_allStats.Add(new WeakReference<
Stats
>(current));