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); } } }
internal static void TerminateSession(Session session) { if (session != null) TerminateSession(session.SessionId); }
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); }