diff Implab/PromiseExtensions.cs @ 136:e9e7940c7d98 v2

shared locks + tests
author cin
date Mon, 16 Feb 2015 01:14:09 +0300
parents a336cb13c6a9
children f75cfa58e3d4
line wrap: on
line diff
--- a/Implab/PromiseExtensions.cs	Fri Feb 13 02:08:01 2015 +0300
+++ b/Implab/PromiseExtensions.cs	Mon Feb 16 01:14:09 2015 +0300
@@ -101,6 +101,11 @@
             int errors = 0;
             var medium = new Promise();
 
+            if (count == 0) {
+                medium.Resolve();
+                return medium;
+            }
+
             medium.On(() => {
                 foreach(var p2 in that)
                     p2.Cancel();