//private static int _count;
            //private readonly int _thisCount;

            internal Snapshot(SnapDictionary <TKey, TValue> store, GenRef genRef)
            {
                _store  = store;
                _genRef = genRef;
                _gen    = genRef.GenObj.Gen;
                _genRef.GenObj.Reference();
                //_thisCount = _count++;
            }
示例#2
0
            public GenRef GetGenRef()
            {
                // not thread-safe but always invoked from within a lock
                var genRef = (GenRef)WGenRef.Target;

                if (genRef == null)
                {
                    WGenRef.Target = genRef = new GenRef(this, Gen);
                }
                return(genRef);
            }
示例#3
0
            //private static int _count;
            //private readonly int _thisCount;

            internal Snapshot(ContentStore store, GenRef genRef
#if DEBUG
                              , ILogger logger
#endif
                              )
            {
                _store  = store;
                _genRef = genRef;
                _gen    = genRef.Gen;
                Interlocked.Increment(ref genRef.GenRefRef.Count);
                //_thisCount = _count++;

#if DEBUG
                _logger = logger;
                _logger.Debug <Snapshot>("Creating snapshot.");
#endif
            }