##// END OF EJS Templates
fixed blocking queue
fixed blocking queue

File last commit:

r138:f75cfa58e3d4 v2
r139:041b77711262 v2
Show More
SyncContextPromise.cs
26 lines | 838 B | text/x-csharp | CSharpLexer
/ Implab / SyncContextPromise.cs
using System.Threading;
using System;
namespace Implab {
public class SyncContextPromise<T> : Promise<T> {
readonly SynchronizationContext m_context;
public SyncContextPromise(SynchronizationContext context) {
Safe.ArgumentNotNull(context, "context");
m_context = context;
}
protected override void SignalSuccess(IDeferred<T> handler) {
m_context.Post(x => base.SignalSuccess(handler), null);
}
protected override void SignalError(IDeferred<T> handler, Exception error) {
m_context.Post(x => base.SignalError(handler, error), null);
}
protected override void SignalCancelled(IDeferred<T> handler, Exception reason) {
m_context.Post(x => base.SignalCancelled(handler, reason), null);
}
}
}