mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
minor: Add warning method doc about possibly inconsistent results returned from BlockingQueue.Contains(), Count() and GetQueueArray()
This commit is contained in:
@@ -89,6 +89,12 @@ namespace OpenSim.Framework
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicate whether this queue contains the given item.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not thread-safe. Do not rely on the result without consistent external locking.
|
||||||
|
/// </remarks>
|
||||||
public bool Contains(T item)
|
public bool Contains(T item)
|
||||||
{
|
{
|
||||||
if (m_queue.Count < 1 && m_pqueue.Count < 1)
|
if (m_queue.Count < 1 && m_pqueue.Count < 1)
|
||||||
@@ -102,11 +108,23 @@ namespace OpenSim.Framework
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return a count of the number of requests on this queue.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not thread-safe. Do not rely on the result without consistent external locking.
|
||||||
|
/// </remarks>
|
||||||
public int Count()
|
public int Count()
|
||||||
{
|
{
|
||||||
return m_queue.Count+m_pqueue.Count;
|
return m_queue.Count + m_pqueue.Count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Return the array of items on this queue.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// This method is not thread-safe. Do not rely on the result without consistent external locking.
|
||||||
|
/// </remarks>
|
||||||
public T[] GetQueueArray()
|
public T[] GetQueueArray()
|
||||||
{
|
{
|
||||||
if (m_queue.Count < 1 && m_pqueue.Count < 1)
|
if (m_queue.Count < 1 && m_pqueue.Count < 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user