##// END OF EJS Templates
fixed AsyncQueue iterator
cin -
r127:d86da8d2d4c3 v2
parent child
Show More
@@ -7,8 +7,6
7 <OutputType>Library</OutputType>
7 <OutputType>Library</OutputType>
8 <RootNamespace>Implab</RootNamespace>
8 <RootNamespace>Implab</RootNamespace>
9 <AssemblyName>Implab</AssemblyName>
9 <AssemblyName>Implab</AssemblyName>
10 <ProductVersion>8.0.30703</ProductVersion>
11 <SchemaVersion>2.0</SchemaVersion>
12 </PropertyGroup>
10 </PropertyGroup>
13 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
11 <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
14 <DebugSymbols>true</DebugSymbols>
12 <DebugSymbols>true</DebugSymbols>
@@ -44,6 +44,10 namespace Implab.Parallels {
44 get { return m_hi; }
44 get { return m_hi; }
45 }
45 }
46
46
47 public int Size {
48 get { return m_size; }
49 }
50
47 public bool TryEnqueue(T value, out bool extend) {
51 public bool TryEnqueue(T value, out bool extend) {
48 var alloc = Interlocked.Increment(ref m_alloc) - 1;
52 var alloc = Interlocked.Increment(ref m_alloc) - 1;
49
53
@@ -562,9 +566,15 namespace Implab.Parallels {
562 m_pos = m_current.Low;
566 m_pos = m_current.Low;
563 else
567 else
564 m_pos++;
568 m_pos++;
569
565 if (m_pos == m_current.Hi) {
570 if (m_pos == m_current.Hi) {
571
572 m_current = m_pos == m_current.Size ? m_current.next : null;
573
566 m_pos = 0;
574 m_pos = 0;
567 m_current = m_current.next;
575
576 if (m_current == null)
577 return false;
568 }
578 }
569
579
570 return true;
580 return true;
General Comments 0
You need to be logged in to leave comments. Login now