Mercurial > pub > ImplabNet
comparison Implab/SyncContextPromiseT.cs @ 211:3eb3255d8cc5 v2
Code review, added a non generic version of SyncContextPromise
author | cin |
---|---|
date | Tue, 21 Mar 2017 17:29:13 +0300 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
210:5dc21f6a3222 | 211:3eb3255d8cc5 |
---|---|
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 |