Mercurial > pub > ImplabNet
comparison Implab/Parallels/ArrayTraits.cs @ 124:a336cb13c6a9 v2
major update, added Drain mathod to AsyncQueue class
author | cin |
---|---|
date | Thu, 15 Jan 2015 02:43:14 +0300 |
parents | 2573b562e328 |
children | 706fccb85524 |
comparison
equal
deleted
inserted
replaced
123:f4d6ea6969cc | 124:a336cb13c6a9 |
---|---|
160 | 160 |
161 object locker = new object(); | 161 object locker = new object(); |
162 int slots = threads; | 162 int slots = threads; |
163 | 163 |
164 // Analysis disable AccessToDisposedClosure | 164 // Analysis disable AccessToDisposedClosure |
165 AsyncPool.InvokeNewThread<int>(() => { | 165 AsyncPool.RunThread<int>(() => { |
166 for (int i = 0; i < source.Length; i++) { | 166 for (int i = 0; i < source.Length; i++) { |
167 if(promise.IsResolved) | 167 if(promise.IsResolved) |
168 break; // stop processing in case of error or cancellation | 168 break; // stop processing in case of error or cancellation |
169 var idx = i; | 169 var idx = i; |
170 | 170 |