diff Implab/AbstractPromise.cs @ 130:671f60cd0250 v2

fixed Resove method bug when calling it on already cancelled promise
author cin
date Fri, 30 Jan 2015 17:07:17 +0300
parents f803565868a4
children f75cfa58e3d4
line wrap: on
line diff
--- a/Implab/AbstractPromise.cs	Thu Jan 29 18:31:06 2015 +0300
+++ b/Implab/AbstractPromise.cs	Fri Jan 30 17:07:17 2015 +0300
@@ -39,12 +39,14 @@
             }
         }
 
-        protected void BeginSetResult() {
+        protected bool BeginSetResult() {
             if (!BeginTransit()) {
                 WaitTransition();
                 if (m_state != CANCELLED_STATE)
                     throw new InvalidOperationException("The promise is already resolved");
+                return false;
             }
+            return true;
         }
 
         protected void EndSetResult() {