示例#1
0
        public void ConcurrentDict_GetOrSet()
        {
            var dict = new System.Collections.Concurrent.ConcurrentDictionary <int, string>();

            dict.GetOrSet(3, () => "bob");
            Assert.Equal("bob", dict.GetValueOrDefault(3));
        }