##// END OF EJS Templates
slowly cutting off mono specific settings
slowly cutting off mono specific settings

File last commit:

r203:4d9830a9bbb8 v2
r230:3e26338eb977 v2
Show More
PromiseHelper.cs
22 lines | 663 B | text/x-csharp | CSharpLexer
using Implab.Parallels;
using System.Threading;
namespace Implab.Test {
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;
});
}
public static IPromise Sleep(int timeout) {
return AsyncPool.Invoke((ct) => {
ct.CancellationRequested(ct.CancelOperation);
Thread.Sleep(timeout);
return 0;
});
}
}
}