//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++; }
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); }
//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 }