Пример #1
0
 internal static void StartSession(int sessionId, bool guestMode)
 {
     lock (sessions)
     {
         Session info;
         if (sessions.TryGetValue(sessionId, out info))
         {
             // TODO: do something with it
         }
         else
         {
             info = new Session(sessionId, guestMode);
             sessions.Add(sessionId, info);
         }
     }
 }
Пример #2
0
 internal static void TerminateSession(Session session)
 {
     if (session != null)
         TerminateSession(session.SessionId);
 }
Пример #3
0
 public SessionLock(Session session, int mode)
 {
     this.session = session;
     this.mode = mode;
     if ((mode & 1) == 1)
         Interlocked.Increment(ref session.m_stateLocks);
     if ((mode & 2) == 2)
         Interlocked.Increment(ref session.m_dbLocks);
 }