aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/LocklessQueue.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/OpenSim/Framework/LocklessQueue.cs b/OpenSim/Framework/LocklessQueue.cs
index dd3d201..84f887c 100644
--- a/OpenSim/Framework/LocklessQueue.cs
+++ b/OpenSim/Framework/LocklessQueue.cs
@@ -99,8 +99,13 @@ namespace OpenSim.Framework
99 } 99 }
100 else 100 else
101 { 101 {
102 item = oldHeadNext.Item; 102 item = oldHeadNext.Item;
103 haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext); 103 haveAdvancedHead = CAS(ref head, oldHead, oldHeadNext);
104 if (haveAdvancedHead)
105 {
106 oldHeadNext.Item = default(T);
107 oldHead.Next = null;
108 }
104 } 109 }
105 } 110 }
106 } 111 }
@@ -111,6 +116,10 @@ namespace OpenSim.Framework
111 116
112 public void Clear() 117 public void Clear()
113 { 118 {
119 // ugly
120 T item;
121 while(count > 0)
122 Dequeue(out item);
114 Init(); 123 Init();
115 } 124 }
116 125