From 0f9253f952b9af4d274b7b69381e64ad77e5b3dc Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Thu, 17 Jan 2019 07:38:00 +0100 Subject: Fix CoreCLR build of AsyncMethodBuilder. --- .../System/Runtime/CompilerServices/AsyncMethodBuilder.cs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs index 4277c00464..aa9d521840 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/CompilerServices/AsyncMethodBuilder.cs @@ -24,6 +24,10 @@ using Internal.Runtime.CompilerServices; using Internal.Runtime.Augments; using Internal.Threading.Tasks; +#if !CORECLR +using Thread = Internal.Runtime.Augments.RuntimeThread; +#endif + namespace System.Runtime.CompilerServices { /// @@ -562,12 +566,12 @@ namespace System.Runtime.CompilerServices /// A delegate to the method. public Action MoveNextAction => _moveNextAction ?? (_moveNextAction = new Action(MoveNext)); - internal sealed override void ExecuteFromThreadPool(RuntimeThread threadPoolThread) => MoveNext(threadPoolThread); + internal sealed override void ExecuteFromThreadPool(Thread threadPoolThread) => MoveNext(threadPoolThread); /// Calls MoveNext on public void MoveNext() => MoveNext(threadPoolThread: null); - private void MoveNext(RuntimeThread threadPoolThread) + private void MoveNext(Thread threadPoolThread) { Debug.Assert(!IsCompleted); @@ -983,8 +987,8 @@ namespace System.Runtime.CompilerServices // enregistrer variables with 0 post-fix so they can be used in registers without EH forcing them to stack // Capture references to Thread Contexts - RuntimeThread currentThread0 = RuntimeThread.CurrentThread; - RuntimeThread currentThread = currentThread0; + Thread currentThread0 = Thread.CurrentThread; + Thread currentThread = currentThread0; ExecutionContext previousExecutionCtx0 = currentThread0.ExecutionContext; // Store current ExecutionContext and SynchronizationContext as "previousXxx". @@ -1001,7 +1005,7 @@ namespace System.Runtime.CompilerServices { // Re-enregistrer variables post EH with 1 post-fix so they can be used in registers rather than from stack SynchronizationContext previousSyncCtx1 = previousSyncCtx; - RuntimeThread currentThread1 = currentThread; + Thread currentThread1 = currentThread; // The common case is that these have not changed, so avoid the cost of a write barrier if not needed. if (previousSyncCtx1 != currentThread1.SynchronizationContext) { -- cgit v1.2.3