internal static void ResetSessionIndex(bool releaseIndex) { if (releaseIndex) { s_sessionSequences.ReleaseValue(SessionIndex.Value); } _sessionIndex = null; }
public void GetFreeIndex() { var m = new SessionIndexProvider(); for (int i = 1; i < 32 * 8; i++) { m.Set(i + 1); } Assert.Equal(1, m.GetFirstFreeValue()); Assert.Equal(8 * 32 + 1, m.GetFirstFreeValue()); m.ReleaseValue(47); Assert.Equal(47, m.GetFirstFreeValue()); Assert.Equal(8 * 32 + 2, m.GetFirstFreeValue()); }