コード例 #1
0
        internal bool CheckForUpdate(int versionId, Timestamps timestamps)
        {
            //Debug.WriteLine(String.Format("##> CheckForUpdate. Id: {0}, time: {1}", versionId, timestamp));
            Timestamps?stored;

            lock (_sync)
            {
                stored = Get(versionId);
                if (stored == null)
                {
                    Add(versionId, timestamps);
                    return(true);
                }
                else
                {
                    if (stored.Value >= timestamps)
                    {
                        return(false);
                    }
                    Update(versionId, timestamps);
                    return(true);
                }
            }
        }
コード例 #2
0
 internal void Update(int versionId, Timestamps timestamps)
 {
     _storage[versionId] = timestamps;
 }