Mercurial > pub > ImplabNet
annotate Implab/SyncContextPromise.cs @ 189:b60643b47078 ref20160224
Закрыть ветку ref20160224
author | cin |
---|---|
date | Fri, 22 Apr 2016 13:07:41 +0300 |
parents | 97fbbf816844 |
children | 3eb3255d8cc5 |
rev | line source |
---|---|
72 | 1 using System.Threading; |
138
f75cfa58e3d4
added ICancellable.Cancel(Exception) to allow specify the reason of cancellation
cin
parents:
119
diff
changeset
|
2 using System; |
72 | 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 | |
156
97fbbf816844
Promises: SignalXXX methods merged into SignalHandler method.
cin
parents:
145
diff
changeset
|
13 protected override void SignalHandler(HandlerDescriptor handler, int signal) { |
97fbbf816844
Promises: SignalXXX methods merged into SignalHandler method.
cin
parents:
145
diff
changeset
|
14 m_context.Post(x => base.SignalHandler(handler, signal), null); |
72 | 15 } |
16 } | |
17 } | |
18 |