Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Henry <ludovic.henry@xamarin.com>2014-11-25 19:34:18 +0300
committerMarek Safar <marek.safar@gmail.com>2016-05-03 01:07:43 +0300
commitc8a99e52fc9917d5fa145c32782fa7a7b33b585e (patch)
tree3e53ae50b703737f8848f6ef1873ffc3bbc0c6c3 /mcs/class/referencesource/mscorlib/system/runtime
parent8abf084f5d3da3192267ba9978911e3a8145528d (diff)
Add mono internal API support
Diffstat (limited to 'mcs/class/referencesource/mscorlib/system/runtime')
-rw-r--r--mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs
index fa6b3d92ca8..5c6833f33e7 100644
--- a/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs
+++ b/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs
@@ -825,16 +825,28 @@ namespace System.Runtime.CompilerServices
// so that they won't "leak" out of the first await.
Thread currentThread = Thread.CurrentThread;
+#if MONO
+ ExecutionContext.Switcher ecs = default (ExecutionContext.Switcher);
+#else
ExecutionContextSwitcher ecs = default(ExecutionContextSwitcher);
+#endif
RuntimeHelpers.PrepareConstrainedRegions();
try
{
+#if MONO
+ currentThread.BranchExecutionContext (out ecs);
+#else
ExecutionContext.EstablishCopyOnWriteScope(currentThread, false, ref ecs);
+#endif
stateMachine.MoveNext();
}
finally
{
+#if MONO
+ currentThread.RestoreExecutionContext (ref ecs);
+#else
ecs.Undo(currentThread);
+#endif
}
}