This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add ManualResetValueTaskSourceCore / AsyncIterateMethodBuilder to Microsoft.Bcl.AsyncInterfaces #37320
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rosoft.Bcl.AsyncInterfaces These two types needed modifications to target .NET Standard 2.0 and are the necessary pieces to enable the compiler to compile async iterators. - Copied ManualResetValueTaskSourceCore.cs from coreclr and tweaked it. I opted to do this rather than ifdef because the changes are not localized and I didn't want to significantly perturb the primary implementation. - Added a few ifdefs to the shared AsyncIteratorMethodBuilder. It already had ifdefs, so I just added to it. - Added a test project, and included the existing ManualResetValueTaskSourceCore tests. I had to disable two of the tests because of some of the optimization differences. - Augmented those tests to validate that the compiler is able to successfully generate iterators and await foreach them.
jkotas
reviewed
May 1, 2019
src/Common/src/CoreLib/System/Runtime/CompilerServices/AsyncIteratorMethodBuilder.cs
Show resolved
Hide resolved
stephentoub
commented
May 1, 2019
@@ -42,7 +42,7 @@ public struct AsyncIteratorMethodBuilder | |||
/// <param name="stateMachine">The state machine instance, passed by reference.</param> | |||
[MethodImpl(MethodImplOptions.AggressiveInlining)] | |||
public void MoveNext<TStateMachine>(ref TStateMachine stateMachine) where TStateMachine : IAsyncStateMachine => | |||
#if CORERT | |||
#if CORERT || MICROSOFT_BCL_ASYNCINTERFACES_PACKAGE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shoot, I meant to revert all changes to this file, but apparently I didn't push that commit. Will do so in a subsequent PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also remove the CORERT ifdef while you are on it? (I will close my PR to remove it then.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, will do.
Changes LGTM. |
picenka21
pushed a commit
to picenka21/runtime
that referenced
this pull request
Feb 18, 2022
…rosoft.Bcl.AsyncInterfaces (dotnet/corefx#37320) * Add ManualResetValueTaskSourceCore / AsyncIterateMethodBuilder to Microsoft.Bcl.AsyncInterfaces These two types needed modifications to target .NET Standard 2.0 and are the necessary pieces to enable the compiler to compile async iterators. - Copied ManualResetValueTaskSourceCore.cs from coreclr and tweaked it. I opted to do this rather than ifdef because the changes are not localized and I didn't want to significantly perturb the primary implementation. - Added a few ifdefs to the shared AsyncIteratorMethodBuilder. It already had ifdefs, so I just added to it. - Added a test project, and included the existing ManualResetValueTaskSourceCore tests. I had to disable two of the tests because of some of the optimization differences. - Augmented those tests to validate that the compiler is able to successfully generate iterators and await foreach them. * Address PR feedback Commit migrated from dotnet/corefx@07b6760
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow-up to #37189
cc: @joperezr, @ericstj, @Petermarcu, @terrajobst
These two types needed modifications to target .NET Standard 2.0 and are the necessary pieces to enable the compiler to compile async iterators.
With this, the package has all the core pieces. The only remaining piece are a few helper extension methods, but I need to first move where they live in coreclr.