internal LockScopeBuilder(ILockScopeDictionary <TKey> dict) { _dict = dict; ToRead = new List <TKey>(); ToWrite = new List <TKey>(); WithTimeout = LockScope.Infinity; }
public static void AssertNotGetWrite <T>(this ILockScopeDictionary <T> dict, params T[] keys) { InvokeInThread(() => { IDisposable scope; if (dict.TryGetScope(null, keys, TimeSpan.FromMilliseconds(0), out scope)) { scope.Dispose(); Assert.Fail("Write was get"); } }); }
public static void AssertGetRead <T>(this ILockScopeDictionary <T> dict, params T[] keys) { InvokeInThread(() => { IDisposable scope; if (!dict.TryGetScope(keys, null, TimeSpan.FromMilliseconds(0), out scope)) { Assert.Fail("Timeout get read"); } scope.Dispose(); }); }
public static void AssertOff <T>(this ILockScopeDictionary <T> dict, T key) { Assert.IsFalse(dict.IsWriteHeld(key)); Assert.IsFalse(dict.IsReadHeld(key)); }