diff options
Diffstat (limited to 'OpenSim/Framework/BlockingQueue.cs')
-rw-r--r-- | OpenSim/Framework/BlockingQueue.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs index 586ccd7..6fbf88f 100644 --- a/OpenSim/Framework/BlockingQueue.cs +++ b/OpenSim/Framework/BlockingQueue.cs | |||
@@ -69,6 +69,23 @@ namespace OpenSim.Framework | |||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | public T Dequeue(int msTimeout) | ||
73 | { | ||
74 | lock (m_queueSync) | ||
75 | { | ||
76 | if (m_queue.Count < 1 && m_pqueue.Count < 1) | ||
77 | { | ||
78 | Monitor.Wait(m_queueSync, msTimeout); | ||
79 | } | ||
80 | |||
81 | if (m_pqueue.Count > 0) | ||
82 | return m_pqueue.Dequeue(); | ||
83 | if (m_queue.Count > 0) | ||
84 | return m_queue.Dequeue(); | ||
85 | return default(T); | ||
86 | } | ||
87 | } | ||
88 | |||
72 | public bool Contains(T item) | 89 | public bool Contains(T item) |
73 | { | 90 | { |
74 | lock (m_queueSync) | 91 | lock (m_queueSync) |