コード例 #1
0
ファイル: UpdateQueue.cs プロジェクト: lbgrid/halcyon
        public KeyValuePair <SceneObjectPart, PrimUpdateFlags>?Dequeue()
        {
            SceneObjectPart part        = null;
            PrimUpdateFlags updateFlags = PrimUpdateFlags.None;

            lock (m_syncObject)
            {
                if (m_queue.Count > 0)
                {
                    part = m_queue.Dequeue();
                    m_ids.Find(part.LocalId, out updateFlags);
                    m_ids.Remove(part.LocalId);

                    return(new KeyValuePair <SceneObjectPart, PrimUpdateFlags>(part, updateFlags));
                }
            }

            return(null);
        }
コード例 #2
0
        public void KillSimEnt(SimEntity simEntity)
        {
            // clone to avoid concurrent modifications from deregister
            HashSet <ISimEventHandle> fromHandles = new HashSet <ISimEventHandle>();

            fromHandles.AddAll <ISimEventHandle>(GetEventsFrom(simEntity));
            foreach (ISimEventHandle eventHandle in fromHandles)
            {
                Deregister(eventHandle);
            }

            _from2set.Remove(simEntity);

            // clone to avoid concurrent modifications from deregister
            HashSet <ISimEventHandle> toHandles = new HashSet <ISimEventHandle>();

            toHandles.AddAll <ISimEventHandle>(GetEventsTo(simEntity));
            foreach (ISimEventHandle eventHandle in toHandles)
            {
                Deregister(eventHandle);
            }
            _to2set.Remove(simEntity);
        }
コード例 #3
0
 public bool RemoveKey(string key)
 {
     lock (m_SyncRoot)
         return(m_Content.Remove(key));
 }