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));
409
foreach (WeakReference<
Stats
> wr in _allStats)
411
if (wr.TryGetTarget(out
Stats
? stats))
422
private
Stats
GetStats() => _stats!.Value!;
441
private void RemoveFromStats(
Stats
current)
447
if (!_allStats[i].TryGetTarget(out
Stats
? stats))
460
private void AddToStats(
Stats
current)
464
_allStats.Add(new WeakReference<
Stats
>(current));