diff Implab.Test/PromiseHelper.cs @ 192:f1da3afc3521 release v2.1

Слияние с v2
author cin
date Fri, 22 Apr 2016 13:10:34 +0300
parents eb793fbbe4ea
children 4d9830a9bbb8
line wrap: on
line diff
--- a/Implab.Test/PromiseHelper.cs	Wed Sep 03 18:34:02 2014 +0400
+++ b/Implab.Test/PromiseHelper.cs	Fri Apr 22 13:10:34 2016 +0300
@@ -1,14 +1,11 @@
 using Implab.Parallels;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Threading;
 
 namespace Implab.Test {
-    class PromiseHelper {
-        public static Promise<T> Sleep<T>(int timeout, T retVal) {
-            return AsyncPool.Invoke(() => {
+    static class PromiseHelper {
+        public static IPromise<T> Sleep<T>(int timeout, T retVal) {
+            return AsyncPool.Invoke((ct) => {
+                ct.CancellationRequested(ct.CancelOperation);
                 Thread.Sleep(timeout);
                 return retVal;
             });