diff Implab.Test/PromiseHelper.cs @ 149:eb793fbbe4ea v2

fixed promises cancellation
author cin
date Wed, 06 May 2015 17:11:27 +0300
parents 91362ffbecf8
children 4d9830a9bbb8
line wrap: on
line diff
--- a/Implab.Test/PromiseHelper.cs	Wed Apr 15 07:30:20 2015 +0300
+++ b/Implab.Test/PromiseHelper.cs	Wed May 06 17:11:27 2015 +0300
@@ -4,7 +4,8 @@
 namespace Implab.Test {
     static class PromiseHelper {
         public static IPromise<T> Sleep<T>(int timeout, T retVal) {
-            return AsyncPool.Invoke(() => {
+            return AsyncPool.Invoke((ct) => {
+                ct.CancellationRequested(ct.CancelOperation);
                 Thread.Sleep(timeout);
                 return retVal;
             });