CopyTo() public method

public CopyTo ( IronPython.Runtime.DictionaryStorage into ) : IronPython.Runtime.DictionaryStorage
into IronPython.Runtime.DictionaryStorage
return IronPython.Runtime.DictionaryStorage
示例#1
0
        public override void Add(ref DictionaryStorage storage, object key, object value)
        {
            lock (this) {
                if (storage == this)
                {
                    var newStore = new CommonDictionaryStorage();
                    _storage.CopyTo(newStore);
                    newStore.AddNoLock(key, value);
                    storage = newStore;
                    return;
                }
            }

            // race, try again...
            storage.Add(ref storage, key, value);
        }