Mercurial > pub > ImplabNet
diff Implab/Parallels/ArrayTraits.cs @ 19:e3935fdf59a2 promises
Promise is rewritten to use interlocked operations instead of locks
author | cin |
---|---|
date | Sun, 10 Nov 2013 00:21:33 +0400 |
parents | 5a4b735ba669 |
children | ee04e1fa78da |
line wrap: on
line diff
--- a/Implab/Parallels/ArrayTraits.cs Fri Nov 08 01:25:42 2013 +0400 +++ b/Implab/Parallels/ArrayTraits.cs Sun Nov 10 00:21:33 2013 +0400 @@ -140,7 +140,7 @@ AsyncPool.InvokeNewThread(() => { for (int i = 0; i < source.Length; i++) { - if(promise.State != PromiseState.Unresolved) + if(promise.IsResolved) break; // stop processing in case of error or cancellation var idx = i; semaphore.WaitOne();