2 instantiations of Stats
Microsoft.Extensions.Caching.Memory (2)
MemoryCache.cs (2)
59
_accumulatedStats = new
Stats
();
60
_stats = new ThreadLocal<Stats>(() => new
Stats
(this));
12 references to Stats
Microsoft.Extensions.Caching.Memory (12)
MemoryCache.cs (12)
27
private readonly List<WeakReference<
Stats
>>? _allStats;
28
private readonly
Stats
? _accumulatedStats;
29
private readonly ThreadLocal<
Stats
>? _stats;
58
_allStats = new List<WeakReference<
Stats
>>();
60
_stats = new ThreadLocal<
Stats
>(() => new Stats(this));
368
foreach (WeakReference<
Stats
> wr in _allStats)
370
if (wr.TryGetTarget(out
Stats
? stats))
381
private
Stats
GetStats() => _stats!.Value!;
400
private void RemoveFromStats(
Stats
current)
406
if (!_allStats[i].TryGetTarget(out
Stats
? stats))
419
private void AddToStats(
Stats
current)
423
_allStats.Add(new WeakReference<
Stats
>(current));