예제 #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);
 }