aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-07-16 23:14:53 +0100
committerJustin Clark-Casey (justincc)2013-07-16 23:14:53 +0100
commitcbc3576ee2ee0afc7cbf66d4d782dfaee9bbdcda (patch)
tree21655bf7d51e35d912eaeda3b9eae61ce095b015
parentRevert "Revert "MSDN documentation is unclear about whether exiting a lock() ... (diff)
downloadopensim-SC_OLD-cbc3576ee2ee0afc7cbf66d4d782dfaee9bbdcda.zip
opensim-SC_OLD-cbc3576ee2ee0afc7cbf66d4d782dfaee9bbdcda.tar.gz
opensim-SC_OLD-cbc3576ee2ee0afc7cbf66d4d782dfaee9bbdcda.tar.bz2
opensim-SC_OLD-cbc3576ee2ee0afc7cbf66d4d782dfaee9bbdcda.tar.xz
minor: Add warning method doc about possibly inconsistent results returned from BlockingQueue.Contains(), Count() and GetQueueArray()
-rw-r--r--OpenSim/Framework/BlockingQueue.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Framework/BlockingQueue.cs b/OpenSim/Framework/BlockingQueue.cs
index cc016b0..aef1192 100644
--- a/OpenSim/Framework/BlockingQueue.cs
+++ b/OpenSim/Framework/BlockingQueue.cs
@@ -89,6 +89,12 @@ namespace OpenSim.Framework
89 } 89 }
90 } 90 }
91 91
92 /// <summary>
93 /// Indicate whether this queue contains the given item.
94 /// </summary>
95 /// <remarks>
96 /// This method is not thread-safe. Do not rely on the result without consistent external locking.
97 /// </remarks>
92 public bool Contains(T item) 98 public bool Contains(T item)
93 { 99 {
94 if (m_queue.Count < 1 && m_pqueue.Count < 1) 100 if (m_queue.Count < 1 && m_pqueue.Count < 1)
@@ -102,11 +108,23 @@ namespace OpenSim.Framework
102 } 108 }
103 } 109 }
104 110
111 /// <summary>
112 /// Return a count of the number of requests on this queue.
113 /// </summary>
114 /// <remarks>
115 /// This method is not thread-safe. Do not rely on the result without consistent external locking.
116 /// </remarks>
105 public int Count() 117 public int Count()
106 { 118 {
107 return m_queue.Count+m_pqueue.Count; 119 return m_queue.Count + m_pqueue.Count;
108 } 120 }
109 121
122 /// <summary>
123 /// Return the array of items on this queue.
124 /// </summary>
125 /// <remarks>
126 /// This method is not thread-safe. Do not rely on the result without consistent external locking.
127 /// </remarks>
110 public T[] GetQueueArray() 128 public T[] GetQueueArray()
111 { 129 {
112 if (m_queue.Count < 1 && m_pqueue.Count < 1) 130 if (m_queue.Count < 1 && m_pqueue.Count < 1)