2 instantiations of Stats
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
62
_accumulatedStats = new
Stats
();
63
_stats = new ThreadLocal<Stats>(() => new
Stats
(this));
12 references to Stats
Microsoft.Extensions.Caching.Memory (12)
MemoryCache.cs (12)
30
private readonly List<WeakReference<
Stats
>>? _allStats;
31
private readonly
Stats
? _accumulatedStats;
32
private readonly ThreadLocal<
Stats
>? _stats;
61
_allStats = new List<WeakReference<
Stats
>>();
63
_stats = new ThreadLocal<
Stats
>(() => new Stats(this));
356
foreach (WeakReference<
Stats
> wr in _allStats)
358
if (wr.TryGetTarget(out
Stats
? stats))
369
private
Stats
GetStats() => _stats!.Value!;
388
private void RemoveFromStats(
Stats
current)
394
if (!_allStats[i].TryGetTarget(out
Stats
? stats))
407
private void AddToStats(
Stats
current)
411
_allStats.Add(new WeakReference<
Stats
>(current));