示例#1
0
        public bool TryGetCacheEntry(ulong baseAddress, out SegmentCacheEntry entry)
        {
            ThrowIfDisposed();

            if (!_cacheIsComplete)
            {
                _cacheLock.EnterReadLock();
            }

            bool res = false;

            try
            {
                res = _cache.TryGetValue(baseAddress, out entry);
            }
            finally
            {
                if (!_cacheIsComplete)
                {
                    _cacheLock.ExitReadLock();
                }
            }

            if (res)
            {
                entry?.UpdateLastAccessTickCount();
            }

            return(res);
        }
示例#2
0
        public bool TryGetCacheEntry(ulong baseAddress, out SegmentCacheEntry?entry)
        {
            _cacheLock.EnterReadLock();
            bool res = false;

            try
            {
                res = _cache.TryGetValue(baseAddress, out entry);
            }
            finally
            {
                _cacheLock.ExitReadLock();
            }

            entry?.UpdateLastAccessTickCount();
            return(res);
        }