SyncContextPromise.cs
18 lines
| 515 B
| text/x-csharp
|
CSharpLexer
/ Implab / SyncContextPromise.cs
cin
|
r72 | using System.Threading; | ||
cin
|
r138 | using System; | ||
cin
|
r72 | |||
namespace Implab { | ||||
public class SyncContextPromise<T> : Promise<T> { | ||||
readonly SynchronizationContext m_context; | ||||
public SyncContextPromise(SynchronizationContext context) { | ||||
Safe.ArgumentNotNull(context, "context"); | ||||
m_context = context; | ||||
} | ||||
cin
|
r156 | protected override void SignalHandler(HandlerDescriptor handler, int signal) { | ||
m_context.Post(x => base.SignalHandler(handler, signal), null); | ||||
cin
|
r72 | } | ||
} | ||||
} | ||||