public bool TryGetValue(KeyT key, out MatchStorageRowList rowList) { if (this.manuallyEnteredReadLock == true) { return(innerDictionary.TryGetValue(key, out rowList)); } if (innerDictionaryRWL.TryEnterReadLock(timeoutMSecs)) { try { return(innerDictionary.TryGetValue(key, out rowList)); } finally { innerDictionaryRWL.ExitReadLock(); } } else { throw new TimeoutException(); } }
public void Add(KeyT key, MatchStorageRowList rowList) { if (this.manuallyEnteredWriteLock == true) { innerDictionary.Add(key, rowList); return; } if (innerDictionaryRWL.TryEnterWriteLock(timeoutMSecs)) { try { innerDictionary.Add(key, rowList); } finally { innerDictionaryRWL.ExitWriteLock(); } } else { throw new TimeoutException(); } }