Exemplo n.º 1
0
        private MemCacheSession(MemCache cache, string sessionId, bool readOnly)
        {
            Contract.Requires(cache != null);

            Cache         = cache;
            m_sessionId   = sessionId;
            m_readOnly    = readOnly;
            m_pinnedToCas = new ConcurrentDictionary <CasHash, int>();

            // No-item is always already here (no special pinning required)
            m_pinnedToCas.TryAdd(CasHash.NoItem, 0);

            SessionEntries = (!readOnly && !string.IsNullOrEmpty(sessionId)) ? new ConcurrentDictionary <StrongFingerprint, int>() : null;
        }
Exemplo n.º 2
0
 // Sessions that may be read-only can never have an ID
 internal MemCacheSession(MemCache cache, bool readOnly)
     : this(cache, null, readOnly)
 {
 }
Exemplo n.º 3
0
 // Sessions with an ID are never read-only
 internal MemCacheSession(MemCache cache, string sessionId)
     : this(cache, sessionId, false)
 {
     Contract.Requires(!string.IsNullOrEmpty(sessionId));
 }