// NOTE: this method _MUST_ be called with the write lock held void AddToCache(string key, MemoryCacheEntry entry, bool update = false) { if (update) { cache [key] = entry; } else { cache.Add(key, entry); } lru.Update(entry); entry.Added(); if (!update) { perfCounters.Increment(MemoryCachePerformanceCounters.CACHE_ENTRIES); } if (entry.IsExpirable) { UpdateExpirable(entry); } }
// NOTE: this method _MUST_ be called with the write lock held void AddToCache (string key, MemoryCacheEntry entry, bool update = false) { if (update) cache [key] = entry; else cache.Add (key, entry); lru.Update (entry); entry.Added (); if (!update) perfCounters.Increment (MemoryCachePerformanceCounters.CACHE_ENTRIES); if (entry.IsExpirable) UpdateExpirable (entry); }