Exemple #1
0
        private CopyStatusClientCachedEntry AddCopyStatusCachedEntryNoLock(Guid dbGuid, AmServerName server, CopyStatusClientCachedEntry status)
        {
            CopyStatusClientCachedEntry copyStatusCachedEntryNoLock = this.GetCopyStatusCachedEntryNoLock(dbGuid, server);
            CopyStatusClientCachedEntry result = copyStatusCachedEntryNoLock;

            if (CopyStatusHelper.CheckCopyStatusNewer(status, copyStatusCachedEntryNoLock))
            {
                this.AddCopyStatusToDbTable(dbGuid, server, status);
                this.AddCopyStatusToServerTable(dbGuid, server, status);
                result = status;
            }
            return(result);
        }
        private CopyStatusServerCachedEntry UpdateCachedCopyStatus(RpcDatabaseCopyStatus2 status)
        {
            CopyStatusServerCachedEntry copyStatusServerCachedEntry = new CopyStatusServerCachedEntry(status);
            CopyStatusServerCachedEntry cachedStatus;

            lock (this.m_statusCacheLocker)
            {
                if (CopyStatusHelper.CheckCopyStatusNewer(copyStatusServerCachedEntry, this.m_cachedStatus))
                {
                    this.m_cachedStatus = copyStatusServerCachedEntry;
                }
                cachedStatus = this.m_cachedStatus;
            }
            return(cachedStatus);
        }