# HG changeset patch
# User cin
# Date 1422371909 -10800
# Node ID d86da8d2d4c3220c4663461b78bb9115af5f6bc0
# Parent f7b2b8bfbb8caec81c78ffdb06511332de041f96
fixed AsyncQueue iterator
diff -r f7b2b8bfbb8c -r d86da8d2d4c3 Implab/Implab.csproj
--- a/Implab/Implab.csproj Mon Jan 26 02:12:01 2015 +0300
+++ b/Implab/Implab.csproj Tue Jan 27 18:18:29 2015 +0300
@@ -7,8 +7,6 @@
Library
Implab
Implab
- 8.0.30703
- 2.0
true
diff -r f7b2b8bfbb8c -r d86da8d2d4c3 Implab/Parallels/AsyncQueue.cs
--- a/Implab/Parallels/AsyncQueue.cs Mon Jan 26 02:12:01 2015 +0300
+++ b/Implab/Parallels/AsyncQueue.cs Tue Jan 27 18:18:29 2015 +0300
@@ -44,6 +44,10 @@
get { return m_hi; }
}
+ public int Size {
+ get { return m_size; }
+ }
+
public bool TryEnqueue(T value, out bool extend) {
var alloc = Interlocked.Increment(ref m_alloc) - 1;
@@ -562,9 +566,15 @@
m_pos = m_current.Low;
else
m_pos++;
+
if (m_pos == m_current.Hi) {
+
+ m_current = m_pos == m_current.Size ? m_current.next : null;
+
m_pos = 0;
- m_current = m_current.next;
+
+ if (m_current == null)
+ return false;
}
return true;