comparison Implab/SyncContextPromise.cs @ 192:f1da3afc3521 release v2.1

Слияние с v2
author cin
date Fri, 22 Apr 2016 13:10:34 +0300
parents 97fbbf816844
children 3eb3255d8cc5
comparison
equal deleted inserted replaced
71:1714fd8678ef 192:f1da3afc3521
1 using System.Threading;
2 using System;
3
4 namespace Implab {
5 public class SyncContextPromise<T> : Promise<T> {
6 readonly SynchronizationContext m_context;
7
8 public SyncContextPromise(SynchronizationContext context) {
9 Safe.ArgumentNotNull(context, "context");
10 m_context = context;
11 }
12
13 protected override void SignalHandler(HandlerDescriptor handler, int signal) {
14 m_context.Post(x => base.SignalHandler(handler, signal), null);
15 }
16 }
17 }
18