public RefCountedConcurrentDictionaryTests() { this.released = new ConcurrentBag <string>(); this.dictionary = new RefCountedConcurrentDictionary <string, string>( valueFactory: this.ValueForKey, valueReleaser: value => this.released.Add(value)); }
public RefCountedConcurrentDictionaryBenchmarks() { this.testObj = new object(); this.refCountedDictionary = new RefCountedConcurrentDictionary <string, object>((_) => this.testObj, null); this.dictionary = new ConcurrentDictionary <string, object>(); this.refCountedDictionary.Get("foo"); this.dictionary.TryAdd("foo", this.testObj); }