private void EnsureCacheExists() { if (_cache != null) return; lock (_locker) { if (_cache == null) _cache = new ObjectCache(); } }
public IObjectCache FindCache() { var items = FindHttpDictionary(); if (!items.Contains(CacheKey)) { lock (items.SyncRoot) { if (!items.Contains(CacheKey)) { var cache = new ObjectCache(); items.Add(CacheKey, cache); return cache; } } } return (ObjectCache)items[CacheKey]; }