示例#1
0
 protected DictionaryImpl(int capacity, DictionaryImpl <TKey, TKeyStore, TValue> other)
 {
     capacity          = AlignToPowerOfTwo(capacity);
     this._entries     = new Entry[capacity];
     this._size        = other._size;
     this._topDict     = other._topDict;
     this._keyComparer = other._keyComparer;
 }
            public Snapshot(DictionaryImpl <TKey, TKeyStore, TValue> dict)
            {
                this._table = dict;

                // linearization point.
                // if table is quiescent and has no copy in progress,
                // we can simply iterate over its table.
                while (true)
                {
                    if (_table._newTable == null)
                    {
                        break;
                    }

                    // there is a copy in progress, finish it and try again
                    _table.HelpCopyImpl(copy_all: true);
                    this._table = (DictionaryImpl <TKey, TKeyStore, TValue>)(this._table._topDict._table);
                }

                // Warm-up the iterator
                MoveNext();
            }
 public SnapshotIDict(DictionaryImpl <TKey, TKeyStore, TValue> dict) : base(dict)
 {
 }