aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/PriorityQueue.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenSim/Framework/PriorityQueue.cs b/OpenSim/Framework/PriorityQueue.cs
index 5b9185e..22ffcdc 100644
--- a/OpenSim/Framework/PriorityQueue.cs
+++ b/OpenSim/Framework/PriorityQueue.cs
@@ -216,6 +216,27 @@ namespace OpenSim.Framework
216 return false; 216 return false;
217 } 217 }
218 218
219 public bool TryOrderedDequeue(out EntityUpdate value, out Int32 timeinqueue)
220 {
221 // If there is anything in imediate queues, return it first no
222 // matter what else. Breaks fairness. But very useful.
223 for (int iq = 0; iq < NumberOfQueues; iq++)
224 {
225 if (m_heaps[iq].Count > 0)
226 {
227 MinHeapItem item = m_heaps[iq].RemoveMin();
228 m_lookupTable.Remove(item.Value.Entity.LocalId);
229 timeinqueue = Util.EnvironmentTickCountSubtract(item.EntryTime);
230 value = item.Value;
231 return true;
232 }
233 }
234
235 timeinqueue = 0;
236 value = default(EntityUpdate);
237 return false;
238 }
239
219 /// <summary> 240 /// <summary>
220 /// Reapply the prioritization function to each of the updates currently 241 /// Reapply the prioritization function to each of the updates currently
221 /// stored in the priority queues. 242 /// stored in the priority queues.