##// END OF EJS Templates
JSON moved to Formats namespace...
JSON moved to Formats namespace Working in RegularDFA

File last commit:

r149:eb793fbbe4ea v2
r163:419aa51b04fd ref20160224
Show More
FuncTask.cs
23 lines | 635 B | text/x-csharp | CSharpLexer
using System;
using System.Threading;
namespace Implab {
public class FuncTask<T> : FuncTaskBase<T>, IDeferred {
readonly Func<T> m_task;
public FuncTask(Func<T> task, Func<Exception, T> error, Func<Exception, T> cancel, bool autoCancellable) : base(error, cancel, autoCancellable) {
m_task = task;
}
public void Resolve() {
if (m_task != null && LockCancelation()) {
try {
SetResult(m_task());
} catch(Exception err) {
HandleErrorInternal(err);
}
}
}
}
}