Add a way to put things at the front of the queue for any throttle group.

Adds a DoubleLocklessQueue and uses it for the outgoing buckets. Added
a flag value to the Throttle Type (again) because although it's hacky, it's
the best of a bad bunch to get the message through the UDP stack to where it's
needed.
This commit is contained in:
Melanie
2013-01-16 19:29:27 +01:00
parent 5c8cced0a1
commit 582cb89beb
5 changed files with 63 additions and 19 deletions

View File

@@ -29,7 +29,7 @@ using System.Threading;
namespace OpenSim.Framework
{
public sealed class LocklessQueue<T>
public class LocklessQueue<T>
{
private sealed class SingleLinkNode
{
@@ -41,7 +41,7 @@ namespace OpenSim.Framework
SingleLinkNode tail;
int count;
public int Count { get { return count; } }
public virtual int Count { get { return count; } }
public LocklessQueue()
{
@@ -76,7 +76,7 @@ namespace OpenSim.Framework
Interlocked.Increment(ref count);
}
public bool Dequeue(out T item)
public virtual bool Dequeue(out T item)
{
item = default(T);
SingleLinkNode oldHead = null;
@@ -136,4 +136,4 @@ namespace OpenSim.Framework
(object)Interlocked.CompareExchange<SingleLinkNode>(ref location, newValue, comparand);
}
}
}
}

View File

@@ -47,6 +47,8 @@ namespace OpenSim.Framework
Texture = 5,
/// <summary>Non-texture assets</summary>
Asset = 6,
HighPriority = 128,
}
[Flags]