Esempio n. 1
0
        private void SetObjectPriority(UUID sogId, Amib.Threading.WorkItemPriority newPrio)
        {
            TimestampedItem <Amib.Threading.WorkItemPriority> prio;

            if (m_objectPriorities.TryGetValue(sogId, out prio))
            {
                prio.Item = newPrio;
                prio.ResetTimestamp();
            }
            else
            {
                m_objectPriorities[sogId] = new TimestampedItem <Amib.Threading.WorkItemPriority>(newPrio);
            }
        }
 // This is called when a call to ADD a profile to _cachedProfileData caused
 // an automatic purge (e.g. when at capacity limit). Use this to keep the
 // parallel data structures (in this case m_userProfilesByName) in sync.
 void _cachedUserInfo_OnItemPurged(TimestampedItem<CachedUserInfo> item)
 {
     // this is called when it's removed from _cachedProfileData, 
     // so we just need to clean up the parallel name dictionary.
     lock (m_userInfoLock)
     {
         // normal name cleanup of a regular cached profile that expired.
         if (m_userInfoByName.ContainsKey(item.Item.UserProfile.Name))
             m_userInfoByName.Remove(item.Item.UserProfile.Name);
     }
 }
Esempio n. 3
0
 // This is called when a call to ADD a profile to _cachedProfileData caused
 // an automatic purge (e.g. when at capacity limit). Use this to keep the
 // parallel data structures (in this case m_userProfilesByName) in sync.
 void _cachedProfileData_OnItemPurged(TimestampedItem<CachedUserInfo> item)
 {
     // this is called when it's removed from _cachedProfileData, 
     // so we just need to clean up the parallel name dictionary.
     lock (_userProfilesLock)
     {
         // Don't remove it from the names cache if it's cached as a LOCAL profile.
         if (!_cachedLocalProfiles.ContainsKey(item.Item.UserProfile.ID))
         {
             // normal name cleanup of a regular cached profile that expired.
             if (m_userProfilesByName.ContainsKey(item.Item.UserProfile.Name))
                 m_userProfilesByName.Remove(item.Item.UserProfile.Name);
         }
     }
 }
 private void SetObjectPriority(UUID sogId, Amib.Threading.WorkItemPriority newPrio)
 {
     TimestampedItem<Amib.Threading.WorkItemPriority> prio;
     if (m_objectPriorities.TryGetValue(sogId, out prio))
     {
         prio.Item = newPrio;
         prio.ResetTimestamp();
     }
     else
     {
         m_objectPriorities[sogId] = new TimestampedItem<Amib.Threading.WorkItemPriority>(newPrio);
     }
 }
Esempio n. 5
0
 public int CompareTo(TimestampedItem<T> other)
 {
     return TimeStamp.CompareTo(other.TimeStamp);
 }